Destini
12-17-2008, 04:18 PM
Hey,
Basically I'm trying to make a top-down game with a player in the center of the screen and a background which moves as the player moves (much like GTA1,2).
What I've currently built is a game which has a background MC and a player MC. The player MC is static in the center of the stage and doesn't move. The background however, moves as the user holds down an array key.
The problem is, how can I check if the player object collides with something within the background (map) such as a building.
If I do:
if(player.hitTestObject(map.building))
then it seems to check whenever the player hits the entire map, as opposed to just the building within the map.
I've seen this kind of game built many times, any suggestions?
Thanks for your help.
Basically I'm trying to make a top-down game with a player in the center of the screen and a background which moves as the player moves (much like GTA1,2).
What I've currently built is a game which has a background MC and a player MC. The player MC is static in the center of the stage and doesn't move. The background however, moves as the user holds down an array key.
The problem is, how can I check if the player object collides with something within the background (map) such as a building.
If I do:
if(player.hitTestObject(map.building))
then it seems to check whenever the player hits the entire map, as opposed to just the building within the map.
I've seen this kind of game built many times, any suggestions?
Thanks for your help.