Pages: 1 ... 58 59 [60]
  Print  
Author Topic: Game Maker Help Thread!  (Read 43576 times)
HaydenDavenport
Seedling
*
Posts: 7


View Profile Email
« Reply #885 on: May 14, 2013, 02:14:54 PM »

Well you could set a timer when they release the left key that stops when the right key is hit. What you would need to do is start a timer counting up when the left key is released. You can't do this with the alarm function easily so I suggest making a timer in the step event. If it is less than a certain number when the right key is pressed then the player should move at the speed he was previously moving at. Otherwise he should start over on his acceleration.

Ok, thanks. I'm not sure how to set a timer, or how to get the game to recognize when a key has been released... Lol...

What would the code look like for one of the keys?
Logged
Nathan Cash
Mossy
*
Posts: 4584



View Profile Email
« Reply #886 on: May 16, 2013, 09:16:23 PM »

Not at CPU ATM. I'll give you code tomarrow.
Logged

SuperX46!
Mossbaby
*
Posts: 420



View Profile
« Reply #887 on: Yesterday at 02:26:34 PM »

Need some help with character switching!
My code:
if keyboard_check_pressed(world.switchKey)
{
instance_change(player2,true);
}

switchKey is obviously stored in the world object, when I do this the player doesn't switch to the other character. His animation is restarted but that's all. He doesn't switch or anything. I put it in the Begin Step event. I also tried moving it to the Step event but the same happened.
« Last Edit: Yesterday at 02:29:07 PM by SuperX46! » Logged


In other news, I got my first unusual!
Moloch
Mossbaby
*
Posts: 370



View Profile WWW
« Reply #888 on: Yesterday at 03:12:52 PM »

Do you have code in the Create event for player2 that sets the sprite/abilities/etc that make it unique from the other player objects? otherwise those variables may be carried over from player2...instance_change is a bit weird.
Logged

SuperX46!
Mossbaby
*
Posts: 420



View Profile
« Reply #889 on: Yesterday at 03:15:02 PM »

Well you see, when I used the instance_destroy and instance_create ones the same thing happened with a few differences (player will stop in mid-air for a split second and will revert back to standing right)
Logged


In other news, I got my first unusual!
Nathan Cash
Mossy
*
Posts: 4584



View Profile Email
« Reply #890 on: Yesterday at 03:42:08 PM »

It's probably because of a structural differences between this engine and the old one you used
Logged

SuperX46!
Mossbaby
*
Posts: 420



View Profile
« Reply #891 on: Yesterday at 10:09:35 PM »

Help me guys.
Logged


In other news, I got my first unusual!
Moloch
Mossbaby
*
Posts: 370



View Profile WWW
« Reply #892 on: Today at 08:55:56 AM »

I don't know. Could it be this issue?
http://gmc.yoyogames.com/index.php?showtopic=519560
Maybe test it by trying another way other than pressing a key to switch characters, like collision with an object that can only be triggered by a certain character.
Logged

SuperX46!
Mossbaby
*
Posts: 420



View Profile
« Reply #893 on: Today at 09:17:38 AM »

I don't know. Could it be this issue?
http://gmc.yoyogames.com/index.php?showtopic=519560
Maybe test it by trying another way other than pressing a key to switch characters, like collision with an object that can only be triggered by a certain character.

Okay I made it so if you touch a certain object you will switch characters. THAT WORKED FINE! This just doesn't work!
Logged


In other news, I got my first unusual!
Moloch
Mossbaby
*
Posts: 370



View Profile WWW
« Reply #894 on: Today at 11:56:04 AM »

Haven't tested this, but from what i understand  the instance replacing the old one is seeing keyboard_check_pressed as true during the same step so try an alarm or counter to disable the switchKey until the next step.

if keyboard_check_pressed(world.switchKey) and world.alarm[0] == 0
{
world.alarm[0] = 1;
instance_change(player2,true);
}

Logged

SuperX46!
Mossbaby
*
Posts: 420



View Profile
« Reply #895 on: Today at 07:13:23 PM »

Tried it. Still doesn't seem to switch. How about this: I send you the source and you help me? Just this once. Please I beg you. I really want to make a good game and this bug is standing in the way. Please
Logged


In other news, I got my first unusual!
Pages: 1 ... 58 59 [60]
  Print  
 
Jump to: