Created
February 7, 2017 14:04
-
-
Save codetravis/a75b944ae4561bd4c58bfe8e5171eb83 to your computer and use it in GitHub Desktop.
14.2 Create a smaller player graphic and load it from the spritesheet
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
Method CreatePlayer() | |
' load the new, smaller player image from the modified sprite sheet, and add the animation frame count | |
Local box:ftObject = engine.CreateAnimImage(game_sprite_atlas.GetImage("player_submarine_two_animation"), 0, 0, | |
96, game_sprite_atlas.GetImageHeight("player_submarine_two_animation"), 4, engine.GetCanvasWidth()/2, engine.GetCanvasHeight()/2) | |
box.SetMaxSpeed(10.0) | |
box.SetMinSpeed(-10.0) | |
box.SetFriction(0.5) | |
box.SetColGroup(PLAYER_GROUP) | |
box.SetColType(Self.engine.ctBox) | |
box.SetText("PLAYER") | |
Local projectile_type:ProjectileType = New ProjectileType() | |
Self.player = New Character(box, projectile_type, 0, 3, "PLAYER") | |
End |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment