ScratchData LogoScratchData
Back to ksdavidc's profile

AP Physics not working 08 27

KSksdavidc•Created August 26, 2021
AP Physics not working 08 27
0
0
5 views
View on Scratch

Instructions

This project explores some problems with Advanced Platformer Physics Wiki http://en.scratch-wiki.info/wiki/Advanced_Platformer_Physics. That page implements a simple model for allowing a character to jump (up arrow) and fall. This "pull out of the ground and go to zero" model says: If I am falling and touching the ground, pull me out of the ground. If I try to jump and **am not falling (i.e. have neg speed)**, set my velocity to zero. This latter is a kind of ceiling detection, but it has some problems. Some behaviors to notice: right now this does not work as the cat just hangs in the air. Eventually there will be other problems. One serious problem with this is that the velocity when I am on the ground keeps decreasing infinitely. For simple games this has no effect, but it could cause problems. Less serious, is that when I jump, my speed goes up, but instantly goes to zero, rather than gradually decreasing. Then it goes to -g where g is the gravity, which is this project is -1. However, this is compensated for slightly because the the jump routine lets me jump if I am not touching the ground. For example, if my jump velocity is say 70, then I roughly go 70 0 -g (up arrow) 70 0 -g (up arrow) 70 0 -g (up arrow) to keep climbing. Whether this is desirable or not could depend on the kind of game play you want.

Description

This used to be the version given on the Advanced Platformer Physics page http://en.scratch-wiki.info/wiki/Advanced_Platformer_Physics of the wiki. It has since been superceded.

Project Details

Project ID564000839
CreatedAugust 26, 2021
Last ModifiedAugust 28, 2021
SharedAugust 26, 2021
Visibilityvisible
CommentsAllowed