Powered by Invision Power Board

 
    Reply to this topicStart new topicStart Poll

> Gamemaker Help
Unspecified
mariokid
  Posted: Jan 27 2006, 08:31 PM
Quote Post


"Wow, my middle finger's the longest!"-Mario
[*]

Group Icon
Group: Members
Posts: 491
Member No.: 1263
Joined: 15-July 05

Status: (0d) [--]


This is going to be hard to explain but......how do you make an object stand still as one sprite when no buttons are pressed, then animate and move around when pressing the left,down, right, and up buttons. So far I set the left, right, up, and down buttons to "jump to a given position," then set the values so they respond to the correct direction. After, I set the <no key> event to change to the sprite that needs to be there when no key is pressed, so the object looks like its standing still. After doing this, the object moves around perfectly, but the original object sprite is the only sprite that is shown when up, down, left, right or no key is pressed. How do I make it so the original sprite plays only when no key is pressed and play a sprite that animates when up, down, left , or right is pressed. If this is hard to read, tell me and I'll try to better explain it.
PM
Top
Unspecified
Draco Icebane
Posted: Jan 27 2006, 08:32 PM
Quote Post


Standard Member
[*][*][*][*][*]


Group Icon
Group: Banned
Posts: 52997
Member No.: 10
Joined: 13-October 03

Status: (71582612m) [XX]


I think this guy's trying to get different animations to work

Apparently only the stopped animation plays
PM
Top
South Africa
Tri
Posted: Jan 27 2006, 08:40 PM
Quote Post


Courtesy of DJ Elly. (lol jsr)
[M][*][*][*][*]
[*][*][*]

Group Icon
Group: Moderators
Posts: 11832
Member No.: 836
Joined: 17-February 05

Status: (0d) [--]


Easy. In the Key events, just set a sprite change equivalent to the direction you're moving. For example, Up = spr_up, Down = spr_down and so forth.


--------------------
PMEmail PosterAOLMSN
Top
Unspecified
mariokid
Posted: Jan 27 2006, 08:47 PM
Quote Post


"Wow, my middle finger's the longest!"-Mario
[*]

Group Icon
Group: Members
Posts: 491
Member No.: 1263
Joined: 15-July 05

Status: (0d) [--]


I'll I need is for the sprite to stand still when no key is pressed and animate when he moves. For example, I need mario to look like hes standing still when no key is pressed and when he moves left or right I need him to animate so he looks like he's running.
PM
Top
Unspecified
Bowserman
Posted: Jan 27 2006, 08:49 PM
Quote Post


WAH! WAH!
[*][*][*][*][*]
[*][*]

Group Icon
Group: Banned
Posts: 16017
Member No.: 738
Joined: 20-December 04

Status: (0d) [--]


I think I sorta understand.

What you could do is, in the create event, set image_single to 0. Then in the <left> and the <right> event, draw the sprites accordingly. So in left, you'd have the action to draw the sprite moving left, and same for right. When you release the key, set the image_single to 0.

And for jumping up, is vspeed > 0 you'd have the jump sprite up, and when vspeed < 0, you'd have the sprite falling down.

Hope that helps somehow.
PMUsers WebsiteMSN
Top
Unspecified
Bowserman
Posted: Jan 27 2006, 08:51 PM
Quote Post


WAH! WAH!
[*][*][*][*][*]
[*][*]

Group Icon
Group: Banned
Posts: 16017
Member No.: 738
Joined: 20-December 04

Status: (0d) [--]


QUOTE (mariokid @ Jan 28 2006, 12:47 PM)
I'll I need is for the sprite to stand still when no key is pressed and animate when he moves. For example, I need mario to look like hes standing still when no key is pressed and when he moves left or right I need him to animate so he looks like he's running.

Sorry for the dp but:

Alright, set these variables.

in create event:
left = false
right = false

in <left>:
left = true
right = false

<right>:
right = true
left = false

in <no key>

if right = true
{
sprite_index=yourspriteright
}
else
if left = true
{
sprite_index=yourspriteleft
}

Hope that helps.
PMUsers WebsiteMSN
Top
Unspecified
mariokid
  Posted: Jan 27 2006, 09:43 PM
Quote Post


"Wow, my middle finger's the longest!"-Mario
[*]

Group Icon
Group: Members
Posts: 491
Member No.: 1263
Joined: 15-July 05

Status: (0d) [--]


asdkfjasklfjas;fksfa;f It finally works!!!!! Thanks everyone. Woot!!!!!!
PM
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

  Topic Options Topic Options Reply to this topicStart new topicStart Poll

 




[ Script Execution time: 0.0445 ]   [ 13 queries used ]   [ GZIP Enabled ]   [ Server Load: 0.77 ]