I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: kilgour22 on June 03, 2014, 11:22:02 PM

Title: Jump Refreshers
Post by: kilgour22 on June 03, 2014, 11:22:02 PM
After a bunch of messing around, I haven't gotten anywhere with creating jump refreshers. Any help would be appreciated. The engine being used is Yuutu.
Title: Re: Jump Refreshers
Post by: HAEGOE on June 03, 2014, 11:30:02 PM
Here's a Jump Refresher code I used



if image_alpha = 1 {
if instance_exists(player){
player.djump = 1;
}
image_alpha = 0;
instance_create(x, y, JumpBonusText);
alarm[0] = 150;
}
//this means when player touch it, you can get player's djump to 1.

use this to when the jump refresher object collides to player, and if you need it for player2(reversed gravity) use that, and change 'player' to 'player2'

image_alpha = 1;

use this at alarm 0. This is for jump refresher's alpha being 1, which is for jump refresher being restored.

Sorry I couldn't make it simpler
Title: Re: Jump Refreshers
Post by: kilgour22 on June 03, 2014, 11:50:36 PM
Here's a Jump Refresher code I used



if image_alpha = 1 {
if instance_exists(player){
player.djump = 1;
}
image_alpha = 0;
instance_create(x, y, JumpBonusText);
alarm[0] = 150;
}
//this means when player touch it, you can get player's djump to 1.

use this to when the jump refresher object collides to player, and if you need it for player2(reversed gravity) use that, and change 'player' to 'player2'

image_alpha = 1;

use this at alarm 0. This is for jump refresher's alpha being 1, which is for jump refresher being restored.

Sorry I couldn't make it simpler

For whatever reason, this cloned the player every time I hit a jump refresher... I have the alarm 0 and a collision event with object player and the code being executed. Any ideas as to what could be causing it?
https://gyazo.com/4b7357e2070f0e76eaeb2a5ca6ef2fda (https://gyazo.com/4b7357e2070f0e76eaeb2a5ca6ef2fda)
Title: Re: Jump Refreshers
Post by: HAEGOE on June 04, 2014, 01:37:12 AM
Oh, Sorry.

if image_alpha = 1 {
if instance_exists(player){
player.djump = 1;
}
image_alpha = 0;
alarm[0] = 150;
}

use this instead. I forgot to delete the code to create an object for extra jump restored effect.
Title: Re: Jump Refreshers
Post by: kilgour22 on June 04, 2014, 03:09:51 PM
Oh, Sorry.

if image_alpha = 1 {
if instance_exists(player){
player.djump = 1;
}
image_alpha = 0;
alarm[0] = 150;
}

use this instead. I forgot to delete the code to create an object for extra jump restored effect.
Thank you! Worked perfectly. :BloodTrail: