Dear readers, I am currently making a flash based role playing game, I use flash 8 basic. I am using very simple code to deal with collisions.
while (_root.wall.hit Test(_root.pc._ x-pc_radius, pc._y, true)) {
now first off pc stands for the player character. Second off when you move him instead of him moving everything else moves to create a scrolling world! Now the source code I used had this exact same code. As you guessed there are four of these bits of code each adjusting to a diffrent side from wich the pc can collide with the wall. Simple enough. In his game the wall was one big movie clip that the player was in, he then hollowed it out to make rooms and hallways. Now when you hit this wall it moves the charecter in a ++ or -- fashion according to where he collided. It works just fine. But in mine I do just the same thing but instead of the charcter moving everything else does to create a scrolling world.
When the pc in my game hits a wall he is bounced to the very edge of the movie clip this end depends on wich side he hit the wall. Do I really have to create hundreds of small sqaure shaped movie clips that make up the walls of the game or can I use just one movie clip or is there a way to clone the properties of that one small sqaure so that I could cut and paste it around the screen and have each one run on the same code like in java
while (_root.wall.hit Test(_root.pc._ x-pc_radius, pc._y, true)) {
now first off pc stands for the player character. Second off when you move him instead of him moving everything else moves to create a scrolling world! Now the source code I used had this exact same code. As you guessed there are four of these bits of code each adjusting to a diffrent side from wich the pc can collide with the wall. Simple enough. In his game the wall was one big movie clip that the player was in, he then hollowed it out to make rooms and hallways. Now when you hit this wall it moves the charecter in a ++ or -- fashion according to where he collided. It works just fine. But in mine I do just the same thing but instead of the charcter moving everything else does to create a scrolling world.
When the pc in my game hits a wall he is bounced to the very edge of the movie clip this end depends on wich side he hit the wall. Do I really have to create hundreds of small sqaure shaped movie clips that make up the walls of the game or can I use just one movie clip or is there a way to clone the properties of that one small sqaure so that I could cut and paste it around the screen and have each one run on the same code like in java