This file contains 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
const a = 'a' | |
const b = 'been' | |
const c = () => { | |
return a | |
} |
This file contains 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
function helloWorld() { | |
return <ShoppingList | |
name="Sunday Shop" | |
items={7} | |
status={2} | |
/> | |
} |
This file contains 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
CustomLoader = function(item) { | |
this.AbstractLoader_constructor(item, false, 'loader') | |
} | |
CustomLoader.getPreloadHandlers = function() { | |
return { | |
types: [ 'some_custom_type' ] | |
callback: CustomLoader.preloadHandler | |
} | |
} |
This file contains 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
@documentMC = @newMovieClip('movieclip_filename', 'MyClassName') | |
# If you enter the class name as the filename you can import the main timeline from the FLA, | |
# unless you have specifically changed the name of the Document class. | |
@mainCnt.addChild @documentMC | |
# **** MONSTER **** # | |
monster = @documentMC.monster | |
monster.onClick = => | |
monster.gotoAndPlay('correct') |
This file contains 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
# add a bitmap | |
newBitmap = @bitmap('my_bitmap') | |
@stage.addChild(newBitmap) | |
# extract frame 2 from a spriteSheet and use it as a bitmap | |
newSpriteSheet = @spriteSheet('my_spritesheet') | |
newSpriteSheet.bitmapFromFrame(2) | |
@stage.addChild(newSpriteSheet) | |
# add a BitmapAnimation |
This file contains 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
# ---------------------------------------------------------- # | |
# EXAMPLE 1 | |
# ---------------------------------------------------------- # | |
# | |
# BAD | |
addPoints: -> | |
pts = [] | |
for i in [0...100] | |
pts.push @getRandomPointFromRect new Rectangle(0, i * 20, 20, 20) |
This file contains 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 | |
<<: *tally | |
tally_spacing: | |
:content: | |
- 35 |
This file contains 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 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 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: |
NewerOlder