Hi all!
I have a map in which I would like to do one of the following:
A: Prevent the Character from walking left (e.g. Ignore the left-arrow keypress)
B: Disable leftward map scrolling and prevent the player from going beyond than the left edge of the screen.
Help for either would be greatly appreciated!
Thanks!
How can I prevent the Character from walking left OR the screen from scrolling left?
● ARCHIVED · READ-ONLY
-
-
The easiest way I could think of is to make an invisible wall - an impassable tile in the B,C,D or E set - that would be 'painted' onto the actual ground tiles, and would prevent the character from walking on it. I'm sure there would be more elegant solutions, so I'll leave those up to the masters.
GB -
I guess what you want is something like in older mario games that you can go farther back than the screen?
You could try experimenting with an parallel process event and checking the character and map position or (if you want to prevent the character from moving left totally) with the passage settings ^^ -
Yeah. I figure some sort of parallel process event with "Character - faces - left" or "Button Press" would work.
If you're doing a side scroller, you could just have an event "behind" (to the left of) the character set to mirror all the player's movements except for left. That way, when you try and go left, there is an event blocking your way. If it's a sidescroller, I think that's the easiest way. -
Oh, I think I get it. Are you asking for the ability to keep the character moving right, without the ability to move left after you move off the screen? In that case, my solution wouldn't work at all.
-
Thanks all.
@Mobychan: Yeah, you got my meaning.
@ Levi: Your idea of a event that follows the player should work. I'll try and get back to everyone.
UPDATE: I have attempted to implement this idea via a parallel process, with three conditional branches:
If Down being pressed, the invisible event moves down
If Right being pressed, the invisible event moves right
if Up being pressed, the invisible event moves up
The invisible event starts out to the left of the player and is not passable.
The problem I'm having, which I am able to observe because my invisible event is not invisible during testing, is it sometimes goes up above the player or down below the player. It's not moving 1-for-1 on the vertical axis.
I'll keep trying things, but if someone has an idea, feel free to shout it out.
Thanks!
UPDATE 2: Another problem with this idea is that it gets out of sync if, for example, the player presses up when the tile above him is IMPASSABLE but the tile above the invisible event is PASSABLE. Must be a better way... -
I'd recommend going away from asking for the button press and just setting the events location to the location left of the player using variables:

This works for me ^^ -
@Mobychan - yep, that does work. Thank you!
I realized after playing it, though, that not being able to walk back when nothing seems to be blocking you feels weird. (Obviously, I realize that's what I asked for, but I didn't have a good sense about how it would be during play...) It would be better if I could put the Player at the left side of the screen (versus the middle). Is that possible?
Thanks! -
You could always use the player as an invisible camera, and have an event on the map that represents the player instead. You'd have to event the button input though and have the event move accordingly through a parallel process.
-
I guess the problem with that would be if you have any obstacles in the way...