8 months 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

If you see this, post a bird.

Wa-hooo!

Thanks to my nephew I finally got my Lucky Shiny Koffing!

SO HAP

I...I think the Fish Pond is working...

Charged Sticker Supporter Shrine for June!

LOOL Look at how slow these gifs are!

This tablet really is rubbish

Thank you all for the support, it really helps me out a lot! And a special thanks to @MomentaryUnicorn for the kofi!

Need to find time to do this!

Woop!

Woop woop!

#pridejolt

HECK

and I must stress this

YEAH!

Building Menu rework is DONE.

Correct indicators for placing and moving stuff, code cleaned up, redundancies removed, duplicate code turned into a script for reuse.

YUS!!

I hope you're all having a great weekend!

It's not as good as when the player fishes, but NPC's can now fish in Fishponds. I need to set up some more variables to get the bobber to bob and to let them be able to cast the line.

Also animate the water...maybe add shader?

That's tomorrows job.