View Full Version : Moving My Character
groog
06-10-2006, 06:09 PM
I havn't done much game making for a while so I forgot most of what I learned. I have a character and want it to stay in the center when I move the keys. To do this instead I have the backround move around instead of my MC (an example of this what stick rpg did. The stick stays in the center while the map moves around it). How do I apply collision detection to this?
My maps code
onClipEvent(enterFrame){
if (Key.isDown(Key.RIGHT)){
_x =_x-2 ;
}
if (Key.isDown(Key.LEFT)){
_x =_x+2 ;
}
if (Key.isDown(Key.UP)){
_y =_y+2 ;
}
if (Key.isDown(Key.DOWN)){
_y =_y-2 ;
}
}
Anyone think they know what I'm talking about?
Soon to be flash master
06-10-2006, 06:16 PM
yeah, how about you make the character move and a camera.. attachmovieclip or something to the character mc, then do hittest the same way.
groog
06-10-2006, 06:19 PM
I've heard of cameras. I've been trying to find one for my animations. Where could I find a tutorial on one?
Soon to be flash master
06-10-2006, 06:56 PM
i could link you a .fla
and i will
*edit*
http://www.zshare.net/download/scriptedcamera-fla.html (http://www.zshare.net/download/scriptedcamera-fla.html)
groog
06-10-2006, 07:15 PM
Thanks :)
Jaroldo
06-10-2006, 09:05 PM
groog ahve u amde ne other games with other characters
Jimbimanim II
06-11-2006, 01:50 AM
groog ahve u amde ne other games with other charactersa tip for you - use propper grammer.
on topic:
i can never get this to work either. ill try the camera you suggested, Soon to be flash master.
Soon to be flash master
06-11-2006, 03:05 AM
im almos positive that i suggested it
Jimbimanim II
06-11-2006, 03:10 AM
o yea...sorry, must have been thinking of a different thread O.o
ill go fix it.
Soon to be flash master
06-11-2006, 03:18 AM
ahh, that wasnt neccasary...
Logic
06-13-2006, 01:56 PM
If you don't want to use a camera, you would need to attach all of the movieclips to the map movieclip and have the character rotate and animate to imitate movement. Then just run normal collision detection with the attached movieclips.
Personally, I would just go with the camera.
Actionscript Helper
06-15-2006, 11:53 AM
Smurf was using that camera thing in his RPG. I saved the URL if you want to see it.
http://www.freewebs.com/smurf-job2/srpg.swf
vBulletin® v3.7.3, Copyright ©2000-2010, Jelsoft Enterprises Ltd.