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
actor = @addActor "sample_actor", SampleActor, parent, {x:10, y:20} |
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
:variables: | |
<<: *caper_common | |
<<: *lives | |
lives_options: | |
:content: | |
- {xoffset: 20, yoffset: 0, lives: 4} |
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
barebones: | |
<<: *js_activity | |
:variables: | |
<<: *caper_common | |
<<: *results_sfx | |
extra_assets: | |
:content: | |
- barebones | |
assets: | |
- image: |
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', | |
'caper/game_states/intro', | |
'caper/game_states/outro', | |
'activities/barebones/main', | |
], (Game, Intro, Outro, Main) -> | |
class Barebones extends Game | |
states: [ | |
['intro', new Intro] |
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) |
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
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
@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
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
define [ | |
'caper/actor' | |
], (Actor) -> | |
class Ball extends Actor | |
added: -> | |
#DRAGGABLE | |
@dragImage = @bitmap 'draggy' | |
@stage.addChild @dragImage |