Platform Behavior.. Making it 'play nice' with customs

For questions about using Classic.

Post » Fri Sep 05, 2008 2:07 pm

I managed to fix a lot of my issues:
- I made a 'foot' detector under the Platformer object. When it's overlapping a "MovingPlatform" family (and "MovingPlatformSprite" and "MovingPlatform3D") object, and 'is on ground', it goes through the following:
-- If the platform is moving left, then move the sprite left, unless the left detector hits a solid. This is important because otherwise moving the sprite left will happen after the platformer logic but before the next set of platformer logic, causing what appears to be a bug to manifest in the platformer logic: if any part of the platformer sprite, including parts that aren't colliding (because they're transparent), is overlapping a solid at the front of a frame, it bumps it up to the top of the platform immediately. This means if your detectors are outside of collision area but inside the bounding boxes, then you might have trouble.
-- Do the same with right
-- For up and down, move the sprite up PLUS one more, or down PLUS one more. This avoids the 'push to the left' issue. Which I think can be easily shown by just having a platformer object, a solid object under it, and moving the solid object up.
- When the head detector is overlapping a moving platform moving down, then move the sprite down, otherwise it ends up 'popping' above the platform.
- When the left/right detectors are overlapping apltform moving right/left, push the character.

I do have a weird issue still where sometimes if you jump on to a platform that's slightly off the ground that's moving toward you, it warps you beneath the level, but I can't find where that's happening. I'll have to wait until debug is fixed. And another where I can get 'hooked' on to the side of a platform moving towards you, but these are compartively minor bugs in that I got the movement correct.

But, to clarify: There's no way to 'simulate' being on a platform using the platform system? It's either solid or nothing?
B
1
G
4
Posts: 7
Reputation: 1,039

Post » Fri Sep 05, 2008 2:31 pm

Er, I must be blind or something, how do I change the attributes of an object in order to make it say, turn solid on and off depending on where the player is? There doesnt seem to be a "Toggle Attribute" function
B
1
G
4
Posts: 7
Reputation: 1,039

Post » Fri Sep 05, 2008 9:04 pm

[quote="webrunner":2huun9zg]Er, I must be blind or something, how do I change the attributes of an object in order to make it say, turn solid on and off depending on where the player is? There doesnt seem to be a "Toggle Attribute" function[/quote:2huun9zg]

It's under Sprite actions: Collisions: Set Collision Mode (None, Point, Per-Pixel, Solid)

And congrats on working things out. It sounds like you're on the right track (and just about at the same point I am as far as moving platforms goes). If you perfect your platforms, post an example :)
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Sep 08, 2008 12:11 pm

Here's what I've got so far, there's a couple of random glitches that make it not trigger the 'crush' function, but the gist is there.:

http://www.savefile.com/files/1775634

- Press ctrl to fire, shift to jump, and arrows to move
- Press 1, 2 to switch weapons
- There are three different Moving Platform families, for three different object types. They pretty much work the same.
- There's some simple enemies
- There's a save room two screens right from the start location.

I noticed there's a bug with the Save/Load - if you try to load a save from a different layout it crashes. As a result it also saves the -layout- to a different file, loads THAT first, and now it doesn't crash.
B
1
G
4
Posts: 7
Reputation: 1,039

Post » Mon Sep 08, 2008 1:28 pm

Not bad. Your vertical platform is about as good as I've ever been able to do, what with the jittering and all.
Moderator
B
5
S
2
G
6
Posts: 4,348
Reputation: 10,971

Post » Mon Sep 08, 2008 2:27 pm

The going-up-jittering could be avoided if only leaving it to it's own devices didn't push it left too :/
B
1
G
4
Posts: 7
Reputation: 1,039

Previous

Return to Help & Support using Construct Classic

Who is online

Users browsing this forum: No registered users and 6 guests