Physics Help for a Game



I’m making a game that is semi-similar to Terraria and I’m wondering how to do the gravity/physics. I have a beta here. Thanks in advance!



What if you just did physics normally? Would it work ok?


What do you mean, normally? Have you looked at the project?


Yes. If you look at the link, there’s a 1 next to it.


Oh. Yeah. I’m really not that great with any kind of physics.


As in, when 7 = 7 increase vertical velocity or whatever by -1 or something. Then have collisions for the character.


I’ll put together a little example in the game and remix it.


Hmm… Maybe? Collisions are the laggiest thing ever though.


It’s not that laggy.



So I took Hopscotchers code and changed it a little, and made jumping work semi properly, (shake to jump) so I got that sort of down for you, but you will still have to perfect it. (Btw good job so far! This is really cool!)


Kinda? I don’t really want him to be bouncing, and I think there’s a better way. I’m just not sure what.


Thanks! I’m pretty happy with what I’ve done so far, and I appreciate you making that but I just made a jumping system I like so I might keep using that.


Looks like you have gotten help with lots of stuff. If you still neeed more help though, feel free to ask!


Yeah… I would prefer not to use when bumps as I feel that would be a cleaner solution but I don’t know how to work out when all the clones aren’t touching the person, and then make gravity come into play.


Oh. I don´t think that I know how to solve your problem, because I haven´t really done much physics in Hopscotch. Sorry!


You know of square collisions right?


Ummm… No? Do you mean detecting if the distance between two objects is < something?


I can help you @MISSION_IMPOSSIBLE, if you still need help, tag me!


(When (cube)is touching (air))
(Check once if (d=1))
(Change y by (-2))
(When (cube) is touching (ground))
(Set (d) to (1))
(When (cube) is touching (ground))
(Repeat forever)
(Check once if (d≠1)
(Set (d) to (1))
(Set (d) to (0))



Another idea? Not sure if it would work, but

When 7=7
(Check Once If (D=1)
Increase Y by -2
When (Cube) is touching (Ground)
Set D to 0
When (Cube) is touching (Air)
Set D to 1
When 7=7
Check If (D=1)
Change Y by Y
Set Y to 0