- Game Maker Community
- → Viewing Profile: Posts: DarkDisguise
DarkDisguise
Member Since 04 Feb 2011Offline Last Active Mar 19 2012 10:42 AM
Community Stats
- Group New Member
- Active Posts 9
- Profile Views 1342
- Member Title GMC Member
- Age 24 years old
- Birthday October 8, 1988
-
Gender
Male
0
none
Friends
DarkDisguise hasn't added any friends yet.
Posts I've Made
In Topic: Fighting stuff
13 February 2012 - 07:59 PM
Any suggestions? :/
In Topic: Fighting stuff
13 February 2012 - 02:53 PM
I rearranged it, but with a different, yet negative, result:
-------
mouse_check_button_pressed(mb_left)
if dir = "right"
{
sprite_index= choose(rightkick, leftkick, rightpunch, leftpunch)
image_speed = 0.1/3
sound_play(swing)
}
--------
and same for the left one.
But now when holding the button it executes every sprite randomly in a cascade of hyper movements.
Sure it looks cool but practical, nope
What I want is when the Left Mouse button is pressed, it should execute a randomly chosen sprite, and play it for just a second or less, then return to it's original position.
Shouldn't be that hard, but I've tried everything so it seems :S
-------
mouse_check_button_pressed(mb_left)
if dir = "right"
{
sprite_index= choose(rightkick, leftkick, rightpunch, leftpunch)
image_speed = 0.1/3
sound_play(swing)
}
--------
and same for the left one.
But now when holding the button it executes every sprite randomly in a cascade of hyper movements.
Sure it looks cool but practical, nope
What I want is when the Left Mouse button is pressed, it should execute a randomly chosen sprite, and play it for just a second or less, then return to it's original position.
Shouldn't be that hard, but I've tried everything so it seems :S
In Topic: Fighting stuff
13 February 2012 - 12:34 PM
mouse_check_button_pressed
Here's the code as it is now
----------------------
if mouse_check_button_pressed(mb_left) && dir = "right"
{
sprite_index= choose(rightkick, leftkick, rightpunch, leftpunch)
image_speed = 0.1/3
sound_play(swing)
}
if mouse_check_button_pressed(mb_left) && dir = "left"
{
sprite_index= choose(rightkick2, leftkick2, rightpunch2, leftpunch2)
image_speed = 0.1/3
sound_play(swing)
}
------------
It's a Global Left Pressed mouse button.
In Topic: Fighting stuff
13 February 2012 - 12:00 PM
Make num of frames smaller than num of steps... or put a decimal that is smaller than 1 (i.e. 0.5)
tried that one, but it's still fast :S
Edit: Don't know if it makes a difference, but I wrote this on top of it.
if mouse_check_button_pressed(mb_left)
{
sprite_index= choose(rightkick, leftkick, rightpunch, leftpunch)
image_speed = 0.1/3
}
In Topic: Fighting stuff
13 February 2012 - 09:59 AM
Yes, you would want to use image_speed.
Doimage_speed = numOfFrames/numOfStepsAnd replace numOfFrames with the number of frames (subimages) you want to see in numOfSteps steps
Doesn't seem to work :S
It's still super fast when pressing the left mouse button
- Game Maker Community
- → Viewing Profile: Posts: DarkDisguise
- Privacy Policy
- GMC Rules and Forum Rules ·



Find content