-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 4b7f17f
Showing
4 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
-- Supported values for orientation: | ||
-- portrait, portraitUpsideDown, landscapeLeft, landscapeRight | ||
|
||
settings = { | ||
|
||
orientation = { | ||
default = "portrait", | ||
supported = { "portrait", } | ||
}, | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
application = { | ||
content = { | ||
width = 320, | ||
height = 480, | ||
scale = "letterBox", | ||
fps = 30, | ||
|
||
--[[ | ||
imageSuffix = { | ||
["@2x"] = 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
--load sprite module | ||
local sprite = require( "sprite" ) | ||
|
||
-- load spritesheet image | ||
-- 1st parameter is a path to the image file | ||
-- 2nd frame width | ||
-- 3rd frame height | ||
local pteroSheet = sprite.newSpriteSheet( "assets/images/ptero_fly_anim.png", 252, 120 ) | ||
|
||
-- create a spriteset | ||
-- 1st parameter is the spritesheet we just created, | ||
-- 2nd is the number of the first frame | ||
-- 3rd is the total nmber of frames in the animation | ||
local pteroSet = sprite.newSpriteSet( pteroSheet, 1, 6 ) | ||
|
||
-- add spriteset to the sprite module, so that we can instanciate it later | ||
-- 1st param is the spriteset we created above | ||
-- 2nd - a name for our animation (we'll use it to create an instance later) | ||
-- 3rd - start frame | ||
-- 4th - number of frames | ||
-- 5th - time in millis for a full animation | ||
-- 6th - number of loops to play, -2 is for continuous looping | ||
sprite.add( pteroSet, "ptero", 1, 6, 300, -2 ) | ||
|
||
--create white background | ||
local background = display.newRect( 0, 0, display.contentWidth, display.contentHeight ) | ||
background:setFillColor( 255 ) | ||
|
||
--create an instance of our animated sprite | ||
local ptero = sprite.newSprite( pteroSet ) | ||
|
||
--center it on screen | ||
ptero:setReferencePoint( display.CenterReferencePoint ) | ||
ptero.x = display.contentWidth / 2 | ||
ptero.y = display.contentHeight / 2 | ||
|
||
-- start animating | ||
ptero:prepare( "ptero" ) | ||
ptero:play() |