Sub onCreate
Scene.SceneAddImage(400, 300, "sky")
Scene.SceneAddImage(400, 300, "star")
'
'add some platforms
platforms = Scene.PhysicsAddStaticGroup
Dim g1 As BANanoObject = Scene.Create(platforms, 400, 568, "ground")
Scene.SetScale(g1, 2)
Scene.RefreshBody(g1)
'
Scene.Create(platforms, 600, 400, "ground")
Scene.Create(platforms, 50, 250, "ground")
Scene.Create(platforms, 750, 220, "ground")
'add a player
'This creates a new sprite called player, positioned at 100 x 450 pixels from the bottom of the game.
'The sprite was created via the Physics Game Object Factory (this.physics.add) which means it has a Dynamic Physics body by default
player = Scene.PhysicsAddSprite(100, 450, "dude")
'After creating the sprite it is given a slight bounce value of 0.2.
'This means when it lands after jumping it will bounce ever so slightly.
Scene.setBounce(player, 0.2)
'The sprite is then set to collide with the world bounds.
'The bounds, by default, are on the outside of the game dimensions.
'As we set the game To be 800 x 600 then the player won't be able to run outside of this area.
'It will stop the player from being able to run off the edges of the screen or jump through the top.
Scene.setCollideWorldBounds(player, True)
'Our player animations, turning, walking left and walking right.
'The 'left' animation uses frames 0, 1, 2 and 3 and runs at 10 frames per second. The 'repeat -1' value tells the animation to loop.
Scene.CreateAnime("left", "dude", 10, 0, 3, -1)
Scene.CreateAnime("turn", "dude", 20, 4, 4, Null)
Scene.CreateAnime("right", "dude", 10, 5, 8, -1)
End Sub