Page 1 of 5

Paralax Scrolling BG + Sprite Animations

Posted: Sun Nov 14, 2010 2:13 pm
by ninwa
Hey all!

So I decided, "Hey, I need to learn how to use AnAL." It's a really great library and I recommend everyone who needs animations check it out, that said, here's my little demo that came from learning it. Maybe I'll make it into a game someday (probably not.)

Oh, also, there's paralax backgrounds. It's really simple to do but if you've ever wondered how feel free to look at the code. I drew the backgrounds (not the sprite), so talented, I know.

Screenshot:
Image

Controls:
  • Left/Right Arrow Keys - Move
    'z' - Jump
    'z' while in air - air jump
    'x' - swing sword
    down arrow - fall faster toward the ground
Download: http://www.josephbleau.com/Paralax.love

Let me know what you think!

PS: Ryne, you should make me some enemy sprites! It took me forever to even get a pre-made sprite cut-up how I wanted it! :(

Re: Paralax Scrolling BG + Sprite Animations

Posted: Sun Nov 14, 2010 2:32 pm
by arquivista
HOLY NINJA ANAL CRAP! That guy really can fly forever! :D
It seems very nice. Badies, badies we need badies...

try this ones
http://home.scarlet.be/~lw039750/PD/Ninja%20Generic.PNG
http://home.scarlet.be/~lw039750/PD/Kit ... eneric.PNG

a lot more here http://home.scarlet.be/~lw039750/

Re: Paralax Scrolling BG + Sprite Animations

Posted: Sun Nov 14, 2010 4:06 pm
by kikito
Looks good, but the animation doesn't seem to work on my comp (Ubuntu with love 6.2)

When keep pressing left or right, the character animation starts, but after the first "step" it freezes.

Re: Paralax Scrolling BG + Sprite Animations

Posted: Sun Nov 14, 2010 4:19 pm
by zac352
WHOA
6.3 MB? :shock:

Re: Paralax Scrolling BG + Sprite Animations

Posted: Sun Nov 14, 2010 4:52 pm
by ninwa
kikito wrote:Looks good, but the animation doesn't seem to work on my comp (Ubuntu with love 6.2)

When keep pressing left or right, the character animation starts, but after the first "step" it freezes.
Hm strange. I'll look into this. Thank you Kikito.

Edit: Actually, this may not be a bug Kikito. Well, not something that only you are experiencing. The character does reach the last frame of his flight animation and "glides." -- I still need to work out how I want to loop between frame 4 and 5 of his flight animation, or if I want to make "beginning to glide" and "gliding" two separate animations.

Anyway, that said, this isn't a Love or platform issue, it's a code issue (assuming the sword animation works for you?)

Re: Paralax Scrolling BG + Sprite Animations

Posted: Sun Nov 14, 2010 5:59 pm
by ninwa
Updated link, added a crate you can bat around, shadows, and sound-effects. I also tweaked how fast you regain flight.

Re: Paralax Scrolling BG + Sprite Animations

Posted: Sun Nov 14, 2010 6:02 pm
by TechnoCat
It takes a long time to catch up to the crate!

Re: Paralax Scrolling BG + Sprite Animations

Posted: Sun Nov 14, 2010 6:03 pm
by zac352
I have a question about spritebatches... How do you use them?
Do you just do love.graphics.draw(batch,x,y)?

Re: Paralax Scrolling BG + Sprite Animations

Posted: Sun Nov 14, 2010 6:05 pm
by ninwa
TechnoCat wrote:It takes a long time to catch up to the crate!
It shouldn't, really. It's velocity is 100-200px/sec on the x-axis and likewise on the y-axis. The character runs at 200px a second so you should be able to keep right up with it, plus there's "friction" so it decelerates pretty quickly. Are you experiencing otherwise? :(
zac352 wrote:I have a question about spritebatches... How do you use them?
Do you just do love.graphics.draw(batch,x,y)?


I'm not using them (directly), nor have any experience with them, so I'm not sure.

Re: Paralax Scrolling BG + Sprite Animations

Posted: Sun Nov 14, 2010 6:08 pm
by TechnoCat
ninwa wrote:It shouldn't, really. It's velocity is 100-200px/sec on the x-axis and likewise on the y-axis. The character runs at 200px a second so you should be able to keep right up with it, plus there's "friction" so it decelerates pretty quickly. Are you experiencing otherwise? :(
I see the crate off to the right when it starts, but to get to it. I have to run for a long time as it slowly crawls towards my player.