Game Development Community

Feature request: setWorldLimit(WRAP...

by Jason Cahill · in Torque Game Builder · 02/26/2005 (10:42 am) · 3 replies

I'm sure this is already on the feature list, Melv and Josh, but I just wanted to request it in case you are questioning it's value. My first thoughts for creating some simple T2D games were to write one or two games "back from the day" of my Apple II and many of them had the notion of a screen that wrapped around in all directions such that when half of a sprite went off the left side, the "missing" half was properly wrapping around the right side.

It looks like it's hinted at in the Torque 2D reference guide:
limitMode -- Sets the world limit mode ("OFF", "NULL", "CLAMP", "STICKY", "BOUNCE", "WRAP", "KILL"

The help below that doesn't mention it and it doesn't appear in the source code. So, perhaps this was cut? or just part of an early plan? Anyway, down the road this would be nice.

#1
02/26/2005 (10:53 am)
I think those limits are in regard to a containment rectangle and how the object will respond to a collision with the bounds?
#2
02/26/2005 (11:00 am)
Well, if there is already a way to accomplish what I want (without having to create up to four sprites for all of the edge cases), then that'd be great!

Certainly in spriit, it seems like setWorldLimit(wrap, ...) would be the right thing, given that it basically means that a sprite's limit is within a specific rectangle and when it gets to an edge, it's behavior should be to wrap, instead of bounce, clamp, etc.

I'm happy to be wrong, though! :-)
#3
02/26/2005 (1:53 pm)
Jason, I think this is a good idea. We do want to add more world limit modes, and this'd be a good one. Thanks. :)

Cool thing about T2D, it takes about 15 mins for us to add stuff like this. ;) Of course, then writing docs around it takes an hour.