Setting walkable space

For questions about using Classic.

Post » Tue Jan 25, 2011 4:29 pm

Hi guys. I was recently playing with a game idea based directly from my childhood favorite anime movie Laputa. The main game world is made of floating islands on which the player can walk around and do stuff. The problem is quite plain if not dumb but i dont know a proper method of making everything except those islands - off limits. just like with normal islands and ocean/water.
I am aware that i can just edit the islands colision mask to have a small solid border but that would imprison the player and limitating.

in normal games you have your gameworld in which you just place obstacle which cannot be passed. i need the exact opposite - to have the whole game world unpassable by default with passable objects.

Have in mind that i also want player to be able to move across that unpassable space from time to time with use of bridges or ballons or ect.

I know what i want - but i dont know how to execute it.
Any ideas? know any methods for simulating this?
ImageImageImageImage
B
26
S
7
G
7
Posts: 572
Reputation: 6,097

Post » Tue Jan 25, 2011 7:27 pm

You could do something like:
->sprite compare x value= clamp(.x,platform left edge, platform right edge)
->0r
->sprite compare x value= clamp(.x,platform2 left edge, platform2 right edge)
->0r
->sprite compare x value= clamp(.x,platform3 left edge, platform3 right edge)
-->sprite set sprite.x to .x

Edit:
Ok .x just stops it, but you could do a last x using a private variable, or:
+ System: (Sprite2.X) Equal to (clamp(Sprite2.x,Sprite.Left+50,Sprite.Right-50))
-> Sprite2: Normal user input
+ System: Else
-> Sprite2: Inverted user input
.... Kinda works.

+ System: Else
-> Sprite2: Bounce
Works well.
Image Image
B
161
S
48
G
90
Posts: 7,356
Reputation: 66,767


Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: GameOverBeast and 1 guest