I’ve been working on a small platformer for a bit now and I put in my scrolling today. Left and right work fine. Exactly how I want it to. So I go to put in the top and bottom scrolling when it doesn’t work.
It’s really odd because I tried it on another similar game and it worked.
What I want it to do is when you drop down a level of the apartment it should follow your character like it does left or right. If you were to go up a set of stairs, it would follow your guy within the limits (_root.ground) no matter where you go.
So, could anyone trouble shoot this? I took the coding out for the up and down but this is what I had on the down (the up was similar)
BOTTOM/DOWN part of movie screen:
if (_root.gabe._y>=0) {
if (!_root.ground.hitTest(_x, getBounds(_root).yMax, true)) {
_root.scrolla = 8;
this._y -= 8;
_root.ground._y -= _root.scrolla;
_root.map._y -= _root.scrolla;
} else {
_root.gabespeed = 8;
}
}
TOP/UP part of movie screen:
if (_root.gabe._y<=200) {
if (!_root.ground.hitTest(_x, getBounds(_root).yMin, true)){
_root.scrolla = 8;
this._y -= 8;
_root.ground._y -= _root.scrolla;
_root.map._y -= _root.scrolla;
} else {
_root.gabespeed = 8;
}
}
I want to apply this to the left and right arrow keys (for walking) and to the jump and aswell as the fall. I think that should be fine to make sure the camera is always following the character.
Right now the movie size is 600 pixels high but I don’t want it to be, I only did that so I could show people my game idea without having to have down scrolling.
The finished game will be 200 pixels in height (about the height of an apartment hallway)
Thank you for any help you can muster up.
FLA: http://www.matthewcorway.com/pagame/pagame1.fla
SWF in an HTML: http://www.matthewcorway.com/pagame/pagame.html