Jump to content


DarkDisguise

Member Since 04 Feb 2011
Offline Last Active Mar 19 2012 10:42 AM

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 :P

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.
Do

image_speed = numOfFrames/numOfSteps
And 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 :(