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

KalleLarsson

Welcome to my page

KalleLarsson's collections

This user has no collections

Recent Comments | Show All

If the scrolling is still something you'd want to implement, for future use when teaching, I've uploaded two scenarios. The first (http://www.greenfoot.org/scenarios/12055) is a simple scrolling demo where I use a fictive cam that pans over the level (which i belive is the most intuitive way to implement scrolling), and the other is a platformer game demo using the first scrolling mechanism, aswell as some other functionality that I think can be fun examples to teach :) The game demo is scenario 12048 If you're interested and have any questions or want better commented code you can just Contact me on karlars [at] live.se if Im not Active on here
KalleLarsson

2014/8/19

Nice game! A simple (but maybe not so nice ) fix to that kind of problem is to limit the maximum velocity of objects. Another is to use getObjectAtOffset for a number of different Points in the direction your object is travelling, to "pre-detect" impact (and since the velocity and the approximate distance is known, a good Point of collision can be estimated, and the collision resolved properly, but this requires some math). I also found that if the mage is standing to the left of the ninja the fireball will slow down and eventually stop in mid air instead of accelereating if they Bounce the ball between eachother... :)