This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define [ | |
'caper/game_state' | |
'easel' | |
'caper/util' | |
'underscore' | |
], (GameState, {Bitmap, Container, Text, SpriteSheet}, {randInt, extractFrame, removeObj}, _) -> | |
class Main extends GameState | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define [ | |
'caper/game_state' | |
'easel' | |
'caper/util' | |
'underscore' | |
], (GameState, {Bitmap, Container, Text, SpriteSheet}, {randInt, extractFrame, removeObj}, _) -> | |
class Main extends GameState | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define [ | |
'caper/game_state' | |
'easel' | |
'caper/util' | |
'underscore' | |
], (GameState, {Bitmap, Container, Text, SpriteSheet}, {randInt, extractFrame, removeObj}, _) -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define [ | |
'caper/actor' | |
], (Actor) -> | |
class SampleActor extends Actor | |
added: (@parent, @pos) -> | |
@cnt = new Container() | |
@cnt.x = @pos.x | |
@cnt.y = @pos.y | |
@parent.addChild @cnt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
define [ | |
'caper/actor' | |
], (Actor) -> | |
class Ball extends Actor | |
added: -> | |
#DRAGGABLE | |
@dragImage = @bitmap 'draggy' | |
@stage.addChild @dragImage |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Main extends Activity | |
enter: -> | |
super | |
@mainCnt = new Container() | |
@stage.addChild @mainCnt | |
@adjustForAspectRatio @mainCnt |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@cnt.addHitArea new Rectangle(0, 0, 200, 300), false | |
@droppable = new Droppable(@cnt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
img = @mySpritesheet.bitmapFromFrame 'frameLabelOrIndex' | |
img.centreRegistrationPoint() | |
@stage.addChild img |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# turn a DisplayObject 'coin' into a Clickable object | |
coin = @bitmap 'coin' | |
coin.centreRegistrationPoint() | |
coin.x = coin.y = 300 | |
@stage.addChild coin | |
@clickable = @makeClickable coin, {over: @bitmap('coin_light'), down: @bitmap('coin_dark')} | |
@clickable.on 'click', @handleClick | |
# use the SimpleButton class to create...a simple button |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# call @method in 2 seconds | |
@delayedCall(2, @method) | |
# delete the delayedCall | |
@tweenMax.killDelayedCallsTo(@method) |
OlderNewer