Game Development Reference
In-Depth Information
Figure 8-12. A dynamic physics object interacting with a static physics object
The rectangle can be replaced with a skin —that is, a graphic—and this is a very easy:
local physics = require "physics"
physics.start()
--
local ground = display.newRect( 0, 460, 320, 20 )
local rect = display.newImage( "DominoTile.png" )
--
physics.addBody( ground, "static")
physics.addBody( rect1 )
--
Timing Is Everything
Many games offer special powers to their players. For example, games like Arkanoid (Breakout) offer
get lasers, multiple balls, and so on. In other games, you might get super-speed or strength for a
limited time, depicted on the screen in the form of a timer, whereby the powers disappear when the
time is up. What if for our game we wanted something similar? For example, say we want to track or
provide some special abilities for a short period of time.
 
Search WWH ::




Custom Search