I have an endless runner game I’m making where your a dinosaur trying to escape from danger. One of the powerups I have is a pterodactyl that comes and picks you up then drops you farther along.
The problem is, when I load the plate up, it takes up over 8mb of texture memory. That was after I cut out nearly half the frames (went from 80 frames down to 47). With the original it took up over 16 mb of texture memory.
The cut down sprite plate is only 281 kb, how is it taking up that much space? Does anyone have any optimization tips?
Here is how I’m creating the plate and the sequences (they’re in functions because I call them from another .lua file):
local get\_PteraSpriteSheetData = function()
local pteraSpriteSheetData = {
width = 171,
height = 171,
numFrames = 50,
sheetContentWidth = 1710,
sheetContentHeight = 855 }
return pteraSpriteSheetData
end
local get\_PteraSequenceData = function()
local pteraSequenceData = {
{name = "carrying", start = 1, count = 36, time = 1500},
{name = "diving", start = 37, count = 10, time = 1500, loopCount = 1, loopDirection = "bounce"} }
return pteraSequenceData
end
And in the game:
local pteraSpriteOptions = animationData.get\_PteraSpriteSheetData()
local pteraSheet = graphics.newImageSheet(\_G.graphicsPath.."ptera\_frames\_plate.png", pteraSpriteOptions)
local ptera = display.newSprite( pteraSheet, animationData.get\_PteraSequenceData() )
Any help would be greatly appreciated.
-Treb [import]uid: 181948 topic_id: 33272 reply_id: 333272[/import]