Hello, i am making an RPG game and i am making different layers to amke the world
like right now i have a layer that goes over top of the player for roofs and stuff and then i have one that goes under for floors, and now i just need one for walls. is there any way i can make a layer a boundary layer? so that anything i draw on that layer my character cannot walk through?
if anyone can help me that would be really great! thanx
Also, i am look for a way to make it so when my character moves around its not actually moving him but its moving the stage.. is this possible?
First of all, these are pretty simple problems. I'm assuming you're new to Flash, and therefore maybe you wanna start with something easier other than an rpg game. What about Pong?!.. Everybody loves Pong! .... right guys?
Seriously though, make a mouse avoider game, with your own original twist, or even a SIMPLE side scrolling shooter?
Anyway, nobody likes being told what to do, so if you wanna carry on with this and are willing to put up with running into these simple problems every hour or so here's what you can do to fix your current problems:
1. Check out a function called 'hitTest()'. Use Flash's help files (they're always handy), and a must-read is the knowledgebase at the top of the games forum as a sticky.. Here's a relevant link from the Knowledgebase sticky that should get you started.
2. Change your current code from this:
PHP Code:
if (Key.isDown(Key.RIGHT)) {
this.character._x += 5;
}
to this:
PHP Code:
if (Key.isDown(Key.RIGHT)) {
this.floor._x += 5;
}
As you can see, in the second example the character will remain in the same spot, but it will appear as though it's moving because the background is moving underneath it