Skip to content

Conversation

@Frogpants
Copy link

In the code for playerBase.js, look for case 'jump', and look for the line of code that specifies " this.yv = this.bottom * -0.04; " this line is in charge of gravity. if the number is closer to zero the gravity decreases, and farther away from zero the gravity increases. (the number has to be negative, otherwise he'll jump into the ground.) This would be good to change for a level with a different gravity than normal.

In the code for character.js, look for updateY under YCol, and look for the line that specifies " this.yv += GameEnv.gravity; " this line is in charge of the speed of the fall increasing as the character falls.

Each level has custom player controls, so for each level, I had to incorporate the new movement into every single file. This includes updating the jumpHeightFactor by dividing it by 10 so that when bouncing on the goombas the player doesn't shoot up. The code works but needs to be improved with collisions but the collision will deal with it and fix the issue. Besides that there is very rudimentary collision code that barely works but can stand by itself if the collison team doesn't figure out a solution to that issue.

@Parallaxes
Copy link

Whoever you are, I just want to thank you as a CSSE 2 student this year for writing this movement logic. Wish I could say more, but thank you :)

Have a great day :D

@Frogpants
Copy link
Author

Whoever you are, I just want to thank you as a CSSE 2 student this year for writing this movement logic. Wish I could say more, but thank you :)

Have a great day :D

No problem, I honestly didn't get to finish some of the collision to make it completely work. If you need any help with it I'll be here.

Have a better day :D
Sincerely, God.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants