ProdigyPNP / ProdigyMathGameHacking

Hacking Prodigy, the math game.
https://prodigypnp.com
Mozilla Public License 2.0
39 stars 62 forks source link

[Hack] WASD movement #138

Closed afkvido closed 2 years ago

afkvido commented 2 years ago

This pull request brings WASD movement into Prodigy Math.

afkvido commented 2 years ago

Not ready quite yet, still needs to be a bit smoother.

ghost commented 2 years ago

How to make collision, divide the movement by (speed)/10, if it touches a wall, go back by (speed)/-7.5 . Using this method has worked for me a lot, also prodigy devs do be slacking tho Tree Shake removes damage edit: repeat the (speed)/10 10 times

afkvido commented 2 years ago

But why would I want to make colliosons? I do like the phasing, I've found it quite useful.

Erisfiregamer1 commented 2 years ago

For people who don't want to- well, phase through walls. Just make it a toggle, "Disable Collisions"

afkvido commented 2 years ago

Bet, let's polish this. Anyways, any idea on how we're gonna add wall checks?

Erisfiregamer1 commented 2 years ago

The same Prodigy does it. Just find whatever they check to ensure players don't noclip through walls and use that,.

ghost commented 2 years ago

Ok better description of the script I described,

Repeat 10 |change (x/y) by speed/10 |if touching wall then ||change (x/y) by speed/-7.5

The script could be done twice for both the x and y axis, or you could take the lazy route of putting them both in the same repeat (not reccomended).

afkvido commented 2 years ago

Lmao idk if this is scratch code or something, but all I'm seeing is this: if touching wall

Alright, so how would we check that?

ghost commented 2 years ago

It is scratch code, but it is an idea of how to implement it

afkvido commented 2 years ago

So... how are we going to check if touching wall?

afkvido commented 2 years ago

resollves conflict by purging bundle lol

Erisfiregamer1 commented 2 years ago

@afkvido try checking it by clicking ahead of where they're going to go, prodigy wont walk the player into the wall. if the event cancells then it's a wall and dont let them move

afkvido commented 2 years ago

Alright, how would you simulate a click?

Erisfiregamer1 commented 2 years ago

Take control of mouse for a split second and click there.

afkvido commented 2 years ago

So we hijack the mouse, target it to the current location then the target location, and we click, if our pos doesn't change then we hit a wall?

afkvido commented 2 years ago

Then we make that as a completley seperate hack, cuz current WASD works by editing player location variables directly.

afkvido commented 2 years ago

Don't get your hopes up- I haven't actually implemented the click-to-move yet.

However, when one hack turns on, the other turns off, it's beautiful!

afkvido commented 2 years ago

@Erisfiregamer1 @donaldli2020 Take a look at... https://developer.mozilla.org/en-US/docs/Web/API/PointerEvent (PoinerEvent, not MouseEvent)