This is basically how I have set this up; there is an object the size of the screen which creates a border around the screen. It's constantly following the screen, so the player will never touch it while they walk around unless they reach the edge of the map/frame. I've also got events that will lock scrolling so the player can only move around in the screen they are in for some periods of time but not leave until they've completed a goal.
My problem is, when the player reaches the edge of the screen and a detector overlaps it, they won't stop. I'm using a custom movement, 8 directions, not built in movement. The same actions work perfectly with collidable backdrops, but they won't work with this frame.
For example;
+ Left detector is overlapping backdrop.
- Set player's X position to X("Player") + 2
This works perfectly fine.
+ Left detector is overlapping FrameDetector.
- Set player's X position to X("Player") + 2
@MacAdaM: It's not off the screen or frame, it's constantly sitting in the frame. I did however try to change those options and it hasn't worked
@AndyUK: Sorry, I think I overcomplicated this in my first post. I'd rather not upload the source, so I will try to explain as clearly as I can with a visual aid.
Disregard what I said about screen locking, my problem is the actual collision.
The red frame around the window is one large active object which follows the frame. It's a red rectangle with the middle of it transparent.
So let's say, we have walked all the way to the left of the actual level/frame, even though the red frame scrolls, when the window can not move any further at the edge of the screen it will stay put around the window.
So the character can walk to the edge but the window doesn't move or scroll to him because its as far left as it can go.
The player can now actually walk to the red frame and touch it because it doesn't move.
(Normally, as it scrolls with the window which centers on the player, he will walk and never reach it when he's in the middle of the level.)
Then the character's left collision detector overlaps this object, so I tell the player to stop. But it won't stop.
This I find weird, it works perfectly fine with backdrops with collision turned on. But not this active object?
As I wrote earlier, the coding is exactly the same yet it won't work..
Can I get this sort of system to work or what are some alternative things I could do?
I dont understand why the player doesnt stop. Cant you just use the same events as touching a wall?
Nevertheless i would just create the playfield far away from the frame edges so you can never reach it.
Looks much better because scrolling stops when you come close to the frames end and everybody knows "ok heres the end of the map". very unrealistic in my opinion.
Yeah, I really don't understand it either, I can't see any problem in my coding or as to why it doesn't work. Looks like I'll have to play around with it and find a more effective way of doing this. Thanks anyway guys!
Try changing the virtual height and virtual width of the frame to the same as the normal dimension plus the border thickness. That way the player will go out of the frame before they touch it. Then that will be your problem.
Virtual width and virtual height lets the frame scroll beyond the play area (into the gray area in the frame editor). Using said feature is good for scrolling without making the frame larger. In this way you can do some things like have collisions outside the frame but visible in the runtime and some other stuff I wouldn't see a point in doing.