How to prevent objects from moving off screen?

For questions about using Classic.

Post » Thu May 28, 2009 7:23 am

Hi guys, I've been through some of the tutorials, forums posts and documentation but I can't seem to find the parameter/code to prevent objects from moving off screen. By objects, I mean those that I've assigned movement behaviors to. Would appreciate it if someone could point me in the right direction.

Thanks :)
B
1
G
3
Posts: 3
Reputation: 831

Post » Thu May 28, 2009 7:42 am

It's a phenomenon known as "Stainsor's Wall." Named after the Scirra Forum user "stainsor" (profile link here), no one is certain exactly what the origin of this strange contraption is. All we know for sure is that it works... the physics behind such a thing is beyond any human understanding.

Here is an example of Stainsor's Wall in action:
http://dl.getdropbox.com/u/529356/stain ... 20wall.cap

If one were to try and define Stainsor's Wall (and believe me, many have), you might say it's "any Solid object placed beyond the boundaries of the Layout so as to contain the movable objects within." Suffice it to say it is truly one of nature's greatest mysteries.

The earliest known manifestation of Stainsor's Wall was documented by the historian Herodotus in the 5th century BC. While taking account of the annual flooding of the Nile river, he wrote:

"Circumstances rule men; men do not rule circumstances. The rising water held at bay not by the workings of mankind, but Providence, for it hath afforded a force beyond reckoning, in the form of a wall; beneficent, yet fraught with dire consequence, for yea though it hold back the raging flood man cannot hope to recompense nor even glean it's true nature. And it is in this that man sees his helplessness, and despairs."
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu May 28, 2009 7:56 am

Hi deadeye, thanks for your swift reply. Would the method above be appropriate if I were to use it in the ghost shooter tutorial to prevent the monsters and the player from moving off screen?
B
1
G
3
Posts: 3
Reputation: 831

Post » Thu May 28, 2009 7:58 am

You can prevent the player from leaving the screen, yes. But the ghosts are bullet objects and have no built-in function to keep them in when hitting a solid object. You could always make a "bounce" event that turns them away from the wall and back into the layout, though.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu May 28, 2009 8:12 am

Ah, that's what I was looking for :D thanks.

ps: interesting commentary on the Stainsor's wall effect. Parmenides would beg to differ. For it was said,

"Helplessness guides the wandering thought in their breasts; they are carried along deaf and blind alike, dazed, beasts without judgment, convinced that to be and not to be are the same and not the same, and that the road of all things is a backward-turning one"
B
1
G
3
Posts: 3
Reputation: 831

Post » Thu May 28, 2009 8:40 am

That sounds like a rather despairing quote to me, actually. Perhaps one in which the helpless do not bemoan their circumstance, but only because they are so far removed from hope that they no longer wail; merely abiding in listless stagnation, the lost wandering in the ashen landscape of a pitifully average existence and wondering only vaguely at the quiet unease that permeates their lives.

This, too, is Stainsor's Wall.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Thu May 28, 2009 9:30 am

I laughed at this whole thread. Awesome.
B
3
S
2
G
5
Posts: 1,777
Reputation: 5,529

Post » Thu May 28, 2009 2:45 pm

[quote="Rich":30erkohq]I laughed at this whole thread. Awesome.[/quote:30erkohq]

This.

HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA

fucking epic

~Sol
Tired of crappy file hosts that are crappy? Get DROPBOX - https://db.tt/uwjysXJF
Moderator
B
45
S
17
G
37
Posts: 2,853
Reputation: 25,966

Post » Thu May 28, 2009 3:04 pm

[quote="deadeye":1ig6yigu]the lost wandering in the ashen landscape[/quote:1ig6yigu]

I laughed when i read this part.

Btw, wall boundaries are not the best method (In some cases they are) because they allow for skip-through with faster moving objects. A raw coordinate boundary is usually the ULTIMATE SAFEST.

Obj.x < 0 ==> set obj x to 0
Obj.x > right boundary ==> set obj x to right boundary x

repeat for y coords.
B
25
S
3
G
6
Posts: 1,197
Reputation: 5,620

Post » Fri May 29, 2009 5:48 am

[quote="Davioware":1pwmsaxg]Btw, wall boundaries are not the best method (In some cases they are) because they allow for skip-through with faster moving objects.[/quote:1pwmsaxg]
I found myself using a wall too since I needed the behavior's reaction to it (bouncing, keeping momentum, etc.). However, proper speed capping and lower-fps bounding fixes the skip-through issue.

Now about this Parmenides fellow, I believe that originally went like this:

[quote="Parmenides":1pwmsaxg]breasts guides the wandering thought Helplessly; they are carried along deaf and blind alike, dazed, beasts without judgment, convinced that to be and not to be are the same and not the same, and that the road of all things is a backward-turning one"[/quote:1pwmsaxg]
Backwards. Yes.
B
3
S
2
G
4
Posts: 1,445
Reputation: 4,665

Next

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 9 guests