Building Android Apps in Python Using Kivy with Android Studio by Ahmed Fawzy Mohamed Gad
Author:Ahmed Fawzy Mohamed Gad
Language: eng
Format: epub
ISBN: 9781484250310
Publisher: Apress
if len(coins_to_delete) > 0:
for coin_key in coins_to_delete:
del TestApp.coins_ids[coin_key]
app = TestApp()
app.run()
Listing 5-43Updating the Label Displaying the Number of Collected Coins and Displaying a Message When the Level Completes
Figure 5-27 shows the result after the level is completed.
Figure 5-27A message is displayed when the level completes
Sound Effects
A game without sound effects is not a very good game. Sound is an important factor of the user experience. You can add sound effects to every action happening in the game. For our game, we will add sound effects to the character’s death, when completing a level, and when collecting coins. This is in addition to the background music, which helps the players engage with the game.
Kivy provides a very simple interface for playing sounds using the SoundLoader class found in the kivy.core.audio module. The modified Python file in which sounds are loaded and played is shown in Listing 5-44.import kivy.app
import kivy.animation
import kivy.uix.image
import kivy.uix.label
import random
import kivy.core.audio
import os
Download
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
Antennas | Microwaves |
Mobile & Wireless | Networks |
Radar | Radio |
Remote Sensing & GIS | Satellite |
Signal Processing | Telephone Systems |
Television & Video |
Whiskies Galore by Ian Buxton(41461)
Introduction to Aircraft Design (Cambridge Aerospace Series) by John P. Fielding(32832)
Small Unmanned Fixed-wing Aircraft Design by Andrew J. Keane Andras Sobester James P. Scanlan & András Sóbester & James P. Scanlan(32516)
Craft Beer for the Homebrewer by Michael Agnew(17885)
Turbulence by E. J. Noyes(7624)
The Complete Stick Figure Physics Tutorials by Allen Sarah(7075)
Kaplan MCAT General Chemistry Review by Kaplan(6510)
The Thirst by Nesbo Jo(6376)
Bad Blood by John Carreyrou(6226)
Modelling of Convective Heat and Mass Transfer in Rotating Flows by Igor V. Shevchuk(6189)
Learning SQL by Alan Beaulieu(5967)
Weapons of Math Destruction by Cathy O'Neil(5728)
Man-made Catastrophes and Risk Information Concealment by Dmitry Chernov & Didier Sornette(5525)
Digital Minimalism by Cal Newport;(5277)
Life 3.0: Being Human in the Age of Artificial Intelligence by Tegmark Max(5111)
iGen by Jean M. Twenge(5100)
Secrets of Antigravity Propulsion: Tesla, UFOs, and Classified Aerospace Technology by Ph.D. Paul A. Laviolette(4818)
Design of Trajectory Optimization Approach for Space Maneuver Vehicle Skip Entry Problems by Runqi Chai & Al Savvaris & Antonios Tsourdos & Senchun Chai(4787)
Electronic Devices & Circuits by Jacob Millman & Christos C. Halkias(4666)
