This site requires JavaScript, please enable it in your browser!
Greenfoot back

danpost's Comments

Back to danpost's profile

I was mistaken. You do have a gravity value there -- but you are subtracting it where you should be adding it.
Also, you have yet to include any gravity values into the movement so that is slows down going up and then starts to come back down. Finally, its vertical decent will need to be stopped when at ground level or when landing on a platform.
You have fallspeed as a double, yet getY will always be an int. You will need to track the vertical position of the actor using a double field and use it instead of getY.
@Xolkiyr, you may want to start a discussion on that.
danpostdanpost

2018/6/18

@Samwcool, you could just download your uploaded scenario (you did include the source).
@JadeGoody, not all scenarios have to be games. This is just something that is visually pleasing. Also, the code was made available so that others may take from it what they can.
HTML5 does not like this, I guess. Clicks stop working after a few.
Updated to run in HTML5 -- but it runs very slow compared to the speed it runs in the greenfoot application.
@Yehuda, correct. the octagram is the eight-pointed star that is drawn; the octagon is the eight-sided shape found in the center of the star.