Windows Complex room boundaries

T

TS26

Guest
Is there a way I could keep a sprite within room boundaries if the room is not rectangular? I've searched and found nothing on this (although I may have missed something). I really don't want to manually code a clamp values to change upon movement.
 

rytan451

Member
How I would do it, personally, is to use an object to hold a non-rectangular shape, and ignore the room shape altogether. If you're using the beta, then you might instead consider using a struct.
 

kburkhart84

Firehammer Games
As stated, you have to be defining those borders somehow. That same somehow is likely to help you detect those borders. For example, if you are scaling wall object instances, you can then collide with those and stay inside(which is a pretty common approach).
 

NightFrost

Member
Any mehtod works that you can integrate to your movement and collision code. As said, invisible blocker instances are one of the most commonly used mechanisms. You'd pair that off with some background graphics or effect cue so it doesn't look like player is just bugging out and getting stuck in empty air.
 
Top