Creating Boundaries

I am stymied once again. I have searched the examples and wore out every combination of key word I could think of. I want the player to stop without crossing past the edge of the known world, in other words I want to create boundaries that cannot be passed without using solid objects. I have paths that will lead to new scenes and I want each scene to look like there is more beyond it, not just completely blocked off by static objects.

I have tried x, y cords and no go (maybe I am doing this wrong), I am currently trying to use dummy objects that are not visible and setting the player to stop if it equals the same x or y position of the dummy object. This second idea seems to me should work perfectly as I do not have to get the cords right just simply state the objects and when they are aligned on either the x or y axis the player should stop moving. This does not work either.

The one example I did find used basically the same idea as my first idea above but it does not work for me.

I’ve got scrolling and player movement working beautifully just got to figure this deal out and then add some color beyond the borders so the player does not see blank space. help with this current issue will be mucho appreciated.

Also, examples with French titles are not very helpful (guess I could copy and translate)

How about solid objects that are invisible (so-called invisible walls)?

Yes you can create Sprite objects (with a image filled with a single color for example) then put them where you want on the scene.
Finally, add an event with no conditions and an action to separate your character from the “Obtacles” objects and another event making obstacles objects invisible and it should be ok.

Open the “Space Marine” template (“Native platform”) for example. :slight_smile:

Right on. I actually used a solid object at the end of one of the roads to do just that but I thought there may be a way to create a boundary around the entire scene via x, y cords. Why did it not work when I set a player to stop moving when its x pos equals that of another object?

Will use the invis objs for now. Thanks all.

Just wondering,

Couldn’t you do

A Up Key is pressed If player is <0x/y II Add to player_object a force of -300 p/s on X axis and 0 p/s on Y axis

Down Key is pressed If player is >0x/y II Add to player_object a force of 300 p/s on X axis and 0 p/s on Y axis

Left Key is pressed If player is >0x/y II Add to player_object a force of 0 p/s on X axis and -300 p/s on Y axis

Down Key is pressed If player is >0x/y II Add to player_object a force of 0 p/s on X axis and 300 p/s on Y axis

Where >0 x/y and <0 x/y are the screen edges? Using this code wouldn’t the code check to see if the player_object is inside the screen and not move in the requested direction if they are going to move outside the screen?

I assumed the same sort of idea Mordios but it did not work. I set the player to stop moving at precise x/y cords based on the readings at the edge of the screen. Now I have extended the base beyond a border of trees for visual effect (so the border is not blank and gives the illusion that the world continues) and used invisible objects to block the road as 4ian stated and this works great.

This is actually better anyway because I did not want the player to be stopped in wide open space for no apparent reason so the tree border works with only a few paths leading through. I have the invisible object set to high mass and when the player runs into it they are transported to the next scene.

This brings up my next question. The scene does not actually change in preview mode but I do get a printout stating that once the game is compiled the player will be switched to the appropriate scene. I checked both marks and the printout gave me the correct scene name each time so I assume this is going to work when compiled. Can the game be compiled to check for this accuracy and then continue to be edited afterwards or does compiling prevent further editing?

One note on Force as well. It has to be tempered somehow for example if used as a directional force with a set number of pixels the character will continue to move after you release the button. I use a force with 0 pixel movement and then add 1 0r 2 to the x/y position of the player. I also use a stop player triggered once if a button is not pressed or the player hits a solid object.

You will be able to continue editing the game even after compiling. Compiling just create the files and the executable that you can then share to the players :slight_smile: