Shooting a gun

How do i assemble the zombie body parts ?

If your image dimension is 1356 x 104 then this can’t be right:

local sheetOptions = { width = 512, height = 256, numFrames = 12 }

1356 / 12 = 113.75 and the height is 104 not 256.  Your image should be evenly divisible by 12 if there are 12 images so even the total width of 1356 doesn’t sound right since it’s not evenly divisible by 12.

Rob

Also, as for making the zombie face left just reverse the xScale like this:

zombie.xScale = -1

I wasn’t talking about left like that but I think I can make it work .

I tried before I put those numbers back and I got a different error .

I meant, you could take that art and hand-assemble the sprites one by one using whatever art program you’re using.

Alternatively, you could take a detour and learn something really cool which is how to use a animation tool:

Having said all that, this is a detour and not a small amount of work or learning, so be cautious before going this direction.

I just made a 4 frame sprite but I keep getting an error .

Incorrect number of frames (w,h) = (160,220) with border (0) in texture (w,h) = (160,220). Failed after frame 2 out of 4.

I had the default width and height and thought that was the problem but it wasn’t . 

This is my code now :

local sheetOptions = { width = 160, height = 220, numFrames = 4 } local sheet\_movingZombie = graphics.newImageSheet( "zombs.png", sheetOptions ) -- sequences table local sequences\_movingZombie = { -- non-consecutive frames sequence { name = "fastRun", frames = { 1,2,3,4 }, time = 400, loopCount = 0, loopDirection = "forward" } }

Can you share this little project with us as a zip file so we can see the whole thing and give you feedback/help?

Use ‘More Reply Options’ button next to orange ‘post’ button to access zip upload feature.

@Brandon/Duke,

Please answer all of these questions so I can better help you in the future:

  1. Are you working on Mac or Windows?

  2. What art tool(s) do you use (choose one or more that you have and know how to use)

  • PhotoShop
  • PaintShopPro
  • Gimp
  • Other? Name it and if you have a link share that too.
  1. What art packs do you have?
  1. Is this your first game engine/sdk or have you worked with any others? 
  • If you have, please name them.
  • It is OK if Corona is your first.  In fact that is just awesome (great choice)!
  1. What programming languages do you know?  It is OK if Lua is your first.

Thanks very much for reading and answering these questions.  It will help me a lot to know these things when helping you in the future.

Knowing this stuff helps me (and others) to be on the same page as you when answering.

This is it.

I am using Windows 7. 

I’m not using any art tools.

I am using Kenney’s packs

This is my first game engine .

I kind of know PHP HTML CSS

The width and height in the imageSheet definition is the frame width and height.  You have the total width and height.  Try:

local sheetOptions = { width = 80, height = 110, numFrames = 4 }

Now I’m not getting anything . No errors or the sprite

This is my updated code :

local sheetOptions = { width = 80, height = 110, numFrames = 4 } local sheet\_movingZombie = graphics.newImageSheet( "zombs.png", sheetOptions ) -- sequences table local sequences\_movingZombie = { -- non-consecutive frames sequence { name = "fastRun", frames = { 1,2,3,4 }, time = 400, loopCount = 0, loopDirection = "forward" } }

Do I have to put it a place for it to show up ? If so where do I put that could ?

Anywhere near the original code, just define the x and y values…

zombie.x = .... zombie.y = ....

@Brandon/Duke,

Thanks for that answer!  It helps me a lot.

I put together a video to help you get a handle on this whole sprite making thing.

Important Links From Video: 

The code: https://github.com/roaminggamer/RG_FreeStuff/raw/master/AskEd/2017/12/brandonSprites.zip

The video (small preamble, then sprite help starts at about 4:30 ):

https://www.youtube.com/watch?v=AxytuiNiLC4&feature=youtu.be

The video quality may take a while to process!  If you watched it right away and it only had 360p, reload it.

All I did was change them to the numbers I posted and this is what I see:

Extremely great tutorial for m thanks A LOT Ed .

I think my background isn’t letting the zombie show up . When I run the code in my example project it shows up but when I run it in the game it doesn’t show up when my background is on the screen . How can i make it show up ? I’ve also noticed this is happening with my coins text