References:
FLA: http://www.matthewcorway.com/pagame/pagame1.fla
SWF in an HTML: http://www.matthewcorway.com/pagame/pagame.html
So, if you were on earlier you saw a topic about me wanting to have my game scroll up and down when you jump past the top border of the document (movie) or if you went down past the border it would scroll down (for when you drop down the stairwells or holes).
So I got this working now but its a little too clunky for my tastes. (probably you would agree)
So how can I take my falling code and make it smoother when it scrolls?
When I put in elevators and stairs, I want the scrolling to go up and down and basically at all times keep the main character in the center of the movie.
So, here is my falling scroll code (applied to the if jumping area (which is also falling))
if (_root.gabe._y>=200) {
if (!_root.ground.hitTest(_x, getBounds(_root).yMin, true)){
_root.scrolla = 100;
this._y -= 100;
_root.ground._y -= _root.scrolla;
_root.map._y -= _root.scrolla;
_root.enemy1._y -= _root.scrolla;
_root.enemy2._y -= _root.scrolla;
_root.enemy3._y -= _root.scrolla;
} else {
_root.gabespeed = 8;
}
}
if (_root.gabe._y<=0) {
if (!_root.ground.hitTest(_x, getBounds(_root).yMax, true)) {
_root.scrolla = 100;
this._y += 100;
_root.ground._y += _root.scrolla;
_root.map._y += _root.scrolla;
_root.enemy1._y += _root.scrolla;
_root.enemy2._y += _root.scrolla;
_root.enemy3._y += _root.scrolla;
} else {
_root.gabespeed = 8;
}
}
Any help on this would be great and I would appreciate it.