Keys and Doors

For questions about using Classic.

Post » Tue Mar 24, 2009 3:09 am

Why are you setting the door to sollid in the first place? Solid objects are unpassable, period. You will never overlap with them. At least, not if you're using a built-in behavior like Platform or 8 Direction.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Tue Mar 24, 2009 8:35 am

Instead of using overlap with the door object i use collision with another object. Even though the door is set to solid (to prevent the player from passing through the door) it still doesn't work. I'm checking for [u:j0po6ohv]collision[/u:j0po6ohv] and not for [u:j0po6ohv]overlaping[/u:j0po6ohv] so i guess it doesn't matter that the door is solid!
B
2
G
4
Posts: 29
Reputation: 1,108

Post » Tue Mar 24, 2009 12:05 pm

[quote="deadeye":3l92pipq]Why are you setting the door to sollid in the first place? Solid objects are unpassable, period. You will never overlap with them. At least, not if you're using a built-in behavior like Platform or 8 Direction.[/quote:3l92pipq]

I was confused about that as well. But when I checked his cap I figured that he wanted the door to be part of the level boundary.

Actually wouldn't it be better Makis to be able to place the door anywhere in the level, so the player can overlap anytime, but only pass through the door with the key? In many platformer games doors are part of the background. So you might want to go for that. But maybe your game concept requires this. After all I don't know.

[quote="makis":3l92pipq]Instead of using overlap with the door object i use collision with another object. Even though the door is set to solid (to prevent the player from passing through the door) it still doesn't work. I'm checking for [u:3l92pipq]collision[/u:3l92pipq] and not for [u:3l92pipq]overlaping[/u:3l92pipq] so i guess it doesn't matter that the door is solid![/quote:3l92pipq]

You are using collision with another object and not the door itself? But your next sentence kind of sounds like you were still using the door itself just with on collision on not overlap. Again, I'm a little confused there. :wink:
EDIT: Oh I get it... the another object thing lol. Of course it's called like that in Construct itself. My bad. Then I guess you can't be on collision with something solid when you're using platform behavior.

Anyway, I made small changes to the cap you posted. It works with offset. Remember if the door was to be approached from a different or both directions you need to have an event with different X offset as well.

Here is the cap
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Mar 24, 2009 12:23 pm

I'm using collision with the door itself. Ok i have to admit by english are crap:cry:
I've managed to fix the problem using a workaround. I placed an invisible solid object in front of the door in order to prevent the player from passing through. The example you post it mate does the job fine and without using 'fake' objects, even though i can't fully understand this offset command.
Sometimes i feel i have the brain of an 8 year old!
B
2
G
4
Posts: 29
Reputation: 1,108

Post » Tue Mar 24, 2009 12:34 pm

I think your english is fine. I just get confused easily. :oops:

Well if you're using overlap at offset it's like you're checking if the object would overlap if it was at a different position. So I'm using (-1,0) offset in the example. Which means that it checks for overlap using the X position of the object minus 1. The Y position remains unchanged since it's 0. Hope that clarifies it a little.

But if you're happy with the use of another sprite, go for it. Anything that works is okay.
B
21
S
6
G
10
Posts: 1,024
Reputation: 7,445

Post » Tue Mar 24, 2009 12:48 pm

Thanks for the clarification PixelRebirth. The fewer objects i use in a game the more manageble it is. The game i've created with GameMaker used a lot of unnecessary objects and after a while it become quite difficult to manage. In the example you've provided using the offset command
you don't use any more objects, resulting in a 'cleaner' and easier to understand example.
Imagine a game with twenty levels or so, each level having it's own 'false' objects, things will start getting unnecessary complicated!
B
2
G
4
Posts: 29
Reputation: 1,108

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 3 guests