Topic:   sprite animation   (Read 15767 times)


0 Members and 5 Guests are viewing this topic.

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
sprite animation
« on: March 08, 2011, 04:39:26 PM »
one thing that confused me since I started using GameMaker was how sprites were handled. I've come to a clearer understanding on how they work, but can't do three things that I really want to do.

• animate the sprite
• make it slide, instead of blink to another space
• sprite rotation

Thank you in advance for any help you can give ;D
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

Zoo


  • GMG Extraordinaire

  • ***


  • Posts: 1686
    • My Bandcamp
Re: sprite animation
« Reply #1 on: March 08, 2011, 05:05:08 PM »
There's no code for sprite rotation (Although maybe al could throw it in to GM 4 Hint hint)
Kirby, your pudgy buddy from dream land, is back again on the game boy®!

Al Staffieri


  • GMG-er

  • **

  • no avatar

  • Posts: 452

  • I love GameMaker
Re: sprite animation
« Reply #2 on: March 09, 2011, 01:20:08 AM »
Quote
• make it slide, instead of blink to another space

Use SPRITEPATH. For some reason this command didn't get put into the scripting help. I just realized it's not in there when I went to look up thye syntax for it.

SPRITEPATH spriteNumber x y speed

spriteNumber is the sprite number
x is the x coordinate to move the sprite to
y is the y coordinate to move the sprite to
speed is how fast to move it. This is actually how many times the sprite will be drawn as it moves there, so a lower number is faster and a higher number is slower.

ON MOUSEDOWN
  SPRITEPATH 1 mousehorz mousevert 100
END MOUSEDOWN

That will move the sprite to the mouse position every time the mouse is clicked. Play around with the 100 at the end to see how the speed changes.

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: sprite animation
« Reply #3 on: March 09, 2011, 02:56:17 PM »
Quote
ON MOUSEDOWN
 Â SPRITEPATH 1 mousehorz mousevert 100
END MOUSEDOWN

Thanks a bunch. I'll use this in my game for sure!
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: sprite animation
« Reply #4 on: March 14, 2011, 09:39:04 PM »
for animating a sprite I wondered if you could put the data variable as a string like:

SPRITE 1 x y filestring$

It didn't work though, so I tried

SPRITE 1 50 50 $file$$

and that didn't work either. Is this even possible?
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to

GMG Kurt


  • GMG-er

  • **


  • Posts: 682

  • Sorry for being such a noob
Re: sprite animation
« Reply #5 on: March 16, 2011, 02:41:23 PM »
Quote

It didn't work though, so I tried

SPRITE 1 50 50 $file$$

and that didn't work either. Is this even possible?

Oh I feel so dumb right now. The second method actually did work, but I didn't have the document saved in the correct folder so it couldn't find the SPRITE files  woops :-[
Just your average Weekend Warrior.
Yes I know I have bad spelling, it's what makes me such a good programmer!

"Old art, weather magnificent or wretched, is always the raw material of new art. The artist's job, though, is to