1 year ago

OH! Different way of doing it.

11 lines of code, no randomness needed to stop them bouncing forever up and down!

This still means individual objects for the balls and bouncers, but no physics engine definitely means this is possible for minigames!


Code:

if gravTrue == true

{

if vsp < vsp_max {vsp += grav;}

}

var _col = noone;

_col = collision_circle(x,y,sprite_width,oSolid,true,true);

if _col

{

var _curSpd = sqrt(sqr(hsp)+sqr(vsp));

var _nAng = point_direction(_col.x,_col.y,x,y);

hsp = dcos(_nAng)*_curSpd;

vsp = -dsin(_nAng)*_curSpd;

}

x+=hsp; y+=vsp;

4
3
3
2
2
1
1
1
1
1
1
1
1
1
1
1
1


4 comments

Loading...

Next up

Happy February! I hope you're all doing well!

I lost a week when I was sick plus a couple more days when Granny had some bad ones, but I have still been hard at it, mostly working on more Ruins stuff bug fixes and optimisations. Lets get to it!

AAAAAAAAAAAAaaaaaaaaaaaaaaaaaaaaaaahhhhhhhh! I got the cute cactus card I wanted!

Recent shinies!

Not great ones tbh, mostly slightly different shades to the originals.

They really need to overhaul the shiny system from the start.

Charged Sticker Appreciation Post!

Thank you all so much for the support, it really helps me out a lot!

I hope you're all doing well and staying safe! Please take care!

PIKACHU NOOOOOoooOOOOo!!!!

I want that cactus card!!

Lol, wish I could force the game to generate things like this, but it's not really possible with the perlin noise generation.

From the weekend😸

Some card pulls since there's a new pack out!

[1 of 3]

because I wanted to?

#Devruary