View Full Version : camera follows player
i need help
March 8th, 2005, 09:48 AM
I have a very large map. How do I make it so that when i move my player around, the camera stays on him??
pomogranate
March 8th, 2005, 10:15 AM
I've been trying to figure that out to, but if you wan't help from someone they need to know wether your game is a platform game, tilebased game, or just plain rpg game. :geek:
superNoobice
March 8th, 2005, 08:47 PM
well, for an RPG game. most likely, i would make the map move insteead of tthe character . making it look like the camera is on him.
JoMan
March 8th, 2005, 10:23 PM
That's what you have to do for most of the scrolling.
kanpai
i need help
March 9th, 2005, 08:56 AM
I've been trying to figure that out to, but if you wan't help from someone they need to know wether your game is a platform game, tilebased game, or just plain rpg game. :geek:
its a tile based game, and i have a birds eye veiw on my character
SeiferTim
March 9th, 2005, 10:25 AM
well, for an RPG game. most likely, i would make the map move insteead of tthe character . making it look like the camera is on him.
Do just like that, only when the map can't move any more (its at the edge of the screen) THEN move the character. That's how a lot of top-down games work, like Zelda...
squishy
March 9th, 2005, 10:34 AM
like so cilkme (http://www.senocular.com/flash/source.php?id=0.122)
i need help
March 21st, 2005, 10:30 AM
Do just like that, only when the map can't move any more (its at the edge of the screen) THEN move the character. That's how a lot of top-down games work, like Zelda...
ok....but how do I do that? :h::blush:
SeiferTim
March 21st, 2005, 11:43 AM
somthing like:
if (map_mc._y < 0) {
map_mc._y-=steps;
} else {
guy_mc._y+=steps;
}
That's probably not exactly right, but something close to that should work. PLay with is a little bit.
i need help
April 1st, 2005, 09:22 AM
somthing like:
if (map_mc._y < 0) {
map_mc._y-=steps;
} else {
guy_mc._y+=steps;
}
That's probably not exactly right, but something close to that should work. PLay with is a little bit.
i just cant get the code to work :S im an action script noob lol
PC_Victim
July 30th, 2005, 07:20 AM
Try copying the actionscript on this file I found!!! It could help you with your problem. :b:
sputnik
August 22nd, 2005, 01:11 PM
hi, I have the same problem, but I used scrolling and the problem is the camera follows the enemy instead of the hero.
Lord Rahl
August 22nd, 2005, 05:53 PM
hi, I have the same problem, but I used scrolling and the problem is the camera follows the enemy instead of the hero.
Check the script. What is in? And what is it linked to?
Smee
August 22nd, 2005, 09:46 PM
I definetly do not suggest moving the map instead of the character. If you plan to take the game past moving around, then moving the map instead of the character can get a little tricky.
For example, you would have to have everything else (enemies, items, etc.) move with the map, while the character moves separately. A much better way to do it is to move the character around in a "screen" MovieClip.. I've attached a simple example to show what I mean. Have the map and character (and enemies and items) inside the "screen", and then just move the character around like normal. Then, have an onEnterFrame to move the screen around depending on the characters position inside the screen. This allows for great and easy flexability.
An example of the flexability is shown in my little thingy here, just click the squares at the bottom to select that square to move around as (like selecting characters in a game). When you select a new character, it just changes one varaible and now you're controlling that one. Great flexability!
EDIT: I had the wrong values for
Map_Size = {x: 700, y: 475};
Screen_Size = {x: 200, y: 150};
Also, I added a border so that you can see the stage size.
Smee
August 26th, 2005, 09:51 PM
So was this solved.. or what? :/
Lord Rahl
August 26th, 2005, 10:21 PM
So was this solved.. or what? :/
Since you were involved, probaly. ;)
squishy
August 27th, 2005, 12:05 PM
I've been trying to figure that out to, but if you wan't help from someone they need to know wether your game is a platform game, tilebased game, or just plain rpg game. :geek:
what is a plain rpg game?:huh:
cholin
August 30th, 2005, 11:18 AM
I definetly do not suggest moving the map instead of the character. If you plan to take the game past moving around, then moving the map instead of the character can get a little tricky.
Im gonna have to disagree there. If your game is coded properly, moving the entire stage is a simple task. What you do is create one movieclip called map or tiles or whatever. Then, place your map/tiles and enemies and items inside this movieclip. This way, to scroll, you just need to get tiles._width and stuff to determine size, and scroll away! It's also easy to remove a map, if you were to switch levels or walk through a secret door or something.
_root.tiles.remove.....
Originally Posted by leveler
I've been trying to figure that out to, but if you wan't help from someone they need to know wether your game is a platform game, tilebased game, or just plain rpg game. :geek:
what is a plain rpg game?:huh:
I think he means an RPG in general. You can have platform games, tile-based games or general RPG's. That would be where you draw the whole map and move around in it, like Zelda and stuff.
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.