This is one of first few projects. I'm making an endless runner with the provided spritesheet using anim8. So far I've been able to make the character run but when it jumps it never stops. Is there a simple way to fix this? I'd also appreciate any other advice.
Continuous Jumping Animation
Forum rules
Before you make a thread asking for help, read this.
Before you make a thread asking for help, read this.
-
- Party member
- Posts: 574
- Joined: Wed Oct 05, 2016 11:53 am
Re: Continuous Jumping Animation
Code: Select all
if isJumping then -- "isJumping == true" is redundant
if player.anim ~= player.animations.jump then
player.anim = player.animations.jump
player.anim:gotoFrame(1)
end
else
if player.anim ~= player.animations.run then
player.anim = player.animations.run
player.anim:gotoFrame(1)
end
end
Re: Continuous Jumping Animation
A couple more questions. How would I make continuously generating platforms out of tilemaps that I have made? How would I make the character jump (go up and back down)? I also have a lot of trouble adding more than one animation so how would I add an attack animation?
Re: Continuous Jumping Animation
Animations go in tables, and each animation itself goes in a super table. Then you can index them relatively easily.
To add multiple possible actions (and account for the way they work when the player is standing, jumping, walking, etc) you should really use a state machine. Here's a sample link to get you started, but there's LOTS of good tutorials out there if you poke around.
https://gamedevelopertips.com/finite-st ... evelopers/
It'll take a while to wrap your head around them, so give it time, make some demos, and come back with more questions.
You can also search my old posts for 'state machine' and you'll find some of my own progress dealing with them. Not my best work, but enough to get started.
To add multiple possible actions (and account for the way they work when the player is standing, jumping, walking, etc) you should really use a state machine. Here's a sample link to get you started, but there's LOTS of good tutorials out there if you poke around.
https://gamedevelopertips.com/finite-st ... evelopers/
It'll take a while to wrap your head around them, so give it time, make some demos, and come back with more questions.
You can also search my old posts for 'state machine' and you'll find some of my own progress dealing with them. Not my best work, but enough to get started.

Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
Re: Continuous Jumping Animation
If the jumping animation has same sollision as just running, then just make jumps in the spritesheet.
Re: Continuous Jumping Animation
Also, in case you haven't seen Sheepolution's animation tutorial: https://www.sheepolution.com/learn/book/17
Any code samples/ideas by me should be considered Public Domain (no attribution needed) license unless otherwise stated.
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 4 guests