I Wanna Community

Fangames => Game Design => Programming Questions => Topic started by: Storm_Lakitu2 on April 03, 2015, 03:26:01 PM

Title: Creating a Quadjump-Collectable
Post by: Storm_Lakitu2 on April 03, 2015, 03:26:01 PM
I created a object that lets you jump another time after the double jump if you collect it (like in Boshy).
I took the code from I wanna be the 8-bit (Sorry Seph, but your game is to appealing to not be raided xD).
Now i wanted to create a Quadjump, You do a Double Jump, collect it, and then can do another 2 Jumps without touching the Ground.
How do i make it?
Here is the code for the Trimple-Jump from 8-bit:
Create:image_speed = 1/4;
active = 1;
timer = 0;

realY = y;
wobbleDistance = 2;
stimer = random_range(-2,2);

Step:if active = 0
    { timer += 1; }
   
if timer > 100
    { visible = 1; active = 1; timer = 0;  }
   
y = realY + sin(stimer) * wobbleDistance;
stimer += 0.05;

Collisson with Player:if active = 1
    {
        player.screw = 0;
        player.djump = 1;
        active = 0;
        visible = 0;
    }
Title: Re: Creating a Quadjump-Collectable
Post by: Sephalos on April 03, 2015, 03:47:26 PM
That's fine, I said it before I don't mind people decompiling my games.

To do a quad jump you'll need to change the way the code works. I'm going to assume you're using yuutu or something similar (my engine is similar to yuutu). The way it works in that engine is it uses "true" and "false" statements to check wheter you have a double jump or not, so you'll have to change those to numbers.
There's one in the player create event, change that one to djump = 1;
Then there's another one in the player steps when the player lands on a block, change that one to djump = 1;
Then finally there's one in the playerJump script, change that one so that when the player double jumps it does djump -= 1; instead of djump = false

Then you'll have to make a object that either does  player.djump = 4; or if you want to collect them until you have 4 player.djump += 1; when a collision with the player happens.
Title: Re: Creating a Quadjump-Collectable
Post by: Storm_Lakitu2 on April 03, 2015, 03:59:06 PM
Im in fact using your engine.
I will try this out and tell you if it worked, thanks for the quick reply.

Another question: Since Boshy isnt available for decompile since its in MMF2, is there any game where i can hget the boshy double jump item? you knowm that little blue orb?
Title: Re: Creating a Quadjump-Collectable
Post by: Sephalos on April 03, 2015, 04:04:44 PM
I'm not sure, you could just play boshy and take a screenshot, then cut out the sprite from the background.
Title: Re: Creating a Quadjump-Collectable
Post by: Storm_Lakitu2 on April 03, 2015, 04:08:42 PM
So, if i do this, it lets me jump 4 times after collecting the item? i only want to jump twice. Any ideas? ;)
Title: Re: Creating a Quadjump-Collectable
Post by: lawatson on April 03, 2015, 05:00:18 PM
change the max value to 2 or something
Title: Re: Creating a Quadjump-Collectable
Post by: Sephalos on April 03, 2015, 05:10:03 PM
change the max value to 2 or something
This. At the bottom of player steps do if djump > 2 { djump = 2; }
Title: Re: Creating a Quadjump-Collectable
Post by: Kyir on April 03, 2015, 06:57:58 PM
Just use a cloud in a bottle from Terraria as your jump refresher.
Title: Re: Creating a Quadjump-Collectable
Post by: lawatson on April 03, 2015, 07:13:40 PM
pls
Title: Re: Creating a Quadjump-Collectable
Post by: Storm_Lakitu2 on April 04, 2015, 08:39:33 AM
I think i got it to work but i dont ned it anymore because i found a better solution :Kappa:

But thanks for the replies here.