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

#GJAsks I thought it would have been Tennis for the Atari 400 which my dad had, but I can't find evidence of the cartridge, so I'm gonna say Joust which I still have from back then!

https://www.youtube.com/watch?v=Rc_mV9bbTpY

OMGOSH, don't sleep on this quest!!!

Shame you can't go over 7 charges

Ooo pretty!

Happy November everyone! I hope you all had a wonderful October! Mostly optimisation and reworks this month.

https://www.patreon.com/posts/141102397

Added more underwater stuff. They aren't too visible. Some of them look a little weird though, I dunno maybe I need to mix the up instead of having single ones.

Nothing I make will ever be better than the tiny birbs

Updating water, added some stuff to make things more visually pleasing. I think I need the tint back or maybe to try different blending. Kinda want to try a displacement map again instead of the directional movement? Need to find that again. (laptop gif)

Quick and dirty Quest system and UI. No idea how to do strike through text so I just added [DONE] to the completed tasks.

WOOP!