I’m thinking of making an Adventure - Atari 2600 type of game in BGE. As it is in some Atari 2600 games (e.g. Adventure, E.T., Berzerk, ect.), when the player moves to the edge of the screen, it switches to another scene (area). I tried to achieve this by making an invisible Sensor mesh and set it to detect when the player hits it, after which - the camera changes to another scene.
The problem is - when the player enters the new area he immediately hits the Sensor mesh for going back to the previous room. What could be a more professional solution when trying to make this type of game layout?
1- use a property to know when the player hits the sensor and wich is the current area and change the way the sensors work.
or
2- put a radar sensor in each camera to detect the player object, when it detects something, it changes the game camera to itself. i think this is better.
radar----->and------->change camera
A lot of ways, i bet you want to use bricks, then simply add a timer property to the sensors, then simply add property(timer) greater then → and → next scene, connect the collision to the same and. only thing to do is resetting the timer so connect a property (actuator) → assign timer property 0
This works (in a way). If the player doesn’t enter another room for some time, the timer will have counted up too much, or if the player would want to reenter the previous room right away after he enters some other one - the timer hasn’t counter up enough.
Maybe I’m a little stupid at this as I am new to the BGE system
Are you changing scenes? Or entering a room by opening a door? You mention both.
If changing scenes, you’ll need a script to put your player back where he was if the player wants to go back. A save/load script maybe.
If a door:
One way is to spawn the sensor meshes on an empty. not sure how your game is setup, but if the player is coliding with one mesh, then the other is ended. Or change a property. or make the player walk away from the door a little ways, another sensor, before the sensor spawns that would allow him to go back. But there are probably better ways to do this.
I would use a keyboard key “E” or joystick button, commonly “Triangle” on PS, “Y” on Xbox. when player collides with sensor, or a ray detects the door. an overlay scene, or text parented to the camera, or a alpha plane with text parented to the camera, using visibility actuators, or better yet a python function. asks "do you want to enter the room? click E " Then you enter. That way the player gets to choose. I might use the overlay scene, and put the keyboard/joystick logic on the overlay scene so it will only work while the overlay scene is active. Just spitballing here.
lots of ways to do it. Looking forward to hearing from others.
I’m trying to achieve the esthetics of the game “Adventure” for the Atari 2600. I’ve put links to it’s gameplay so you can see how the player enters other areas.
Also, You mentioned that the player controls could be set up to be used with a Xbox joystick. Does that mean that it’s possible to run a “Blender” game on an Xbox console (preferably the Xbox 360)?
Figured it out!
I created an empty cube and set it as a “sensor”. Then made logic bricks for it, like so:
Collision (property: player) --> and --> Scene (set camera)
put the empty cubes on the edge of the exits/entrances and voilà!
You can use controller connected to pc and use it to navigate trough your game. but exporting game to other then windows/mac/linux is a no go (some forks can export to android as well, but that’s it).
cool, glad you got it. You could also spawn tiles, place Empties at the doors or screen edges, then use python, own.worldPosition = Empty.worldposition to place your player at the next tile. So he doesn’t collide with the trigger. (own is your player) I could post a blend, but it looks like you got it .
WSAD to move.
My python isn’t very strong yet, so there may be better ways to code this.
It would be cool to get some feedback on it though, in case anyone else wanted to do it.
i found out the overlap didnt work as well as i thought, so i added padding to the distance check. the player needs to be more out of the room than in to trigger the change.