Platform collapse programming problem

platformcollapse

Alright so my platform is working perfectly-- by itself. In this gif, it’s doing exactly what I want it to do, which is wonderful!

The problem is, is whenever I jump onto another platform of the same type.

platformcollapse2

Here is the programming, by the way:

I know what’s happening. I know that both platforms are being affected by the same code the moment both are ‘shaking’ (Or in the code, Animation 5) but for some reason, and maybe it’s because I’ve been looking at this too long: I cannot figure out how to resolve it.

I tried putting all the code under ‘each instance of Platforms’ but that didn’t work and got even buggier. I’m CERTAIN there is an easy solution, an easy line of code to fix it, an easy variable, something, but for the life of me I just can’t figure it out.

Could be because I’ve been sorta programming for 3 days straight (I’m having too much fun with my game) but I just. My brain won’t go any further with this issue.

If yall could help me with this I’d be so appreciative! You’ve been lifesavers in the past.

Thanks in advance!

-CQ

You’re using a scene timer for your collapse in your conditions and actions. Since you want each instance of the platform to collapse differently, you should instead use an object timer.

Edit:

Also, never use the “And” condition by itself. It’s designed for use with the “OR” condition. All conditions that are in the same condition box are already treated as “And”. By using the and conditions in all of your events as you have, you are bloating your project filesize and code, and could potentially run into issues down the road.

I have a VERY similar thing in my game. Below is the events. Hopefully it can be of some help. (This was done a couple years ago and uses timers. The new “wait” action might be useful, too.)

ezgif.com-gif-maker

Hey, thank you for letting me know about the “And” by itself! I’m still a programming newbie, so I wouldn’t have known that without someone letting me know. I certainly want to make this game as smooth as possible and have as few bugs to fix before release as possible too. Thank you!

@beanmatt Your events look so short and clean! If you don’t mind, I think I might retool what I’ve done to be more similar to yours. I appreciate the screenshot a lot, and I can tell it works fantastic in your project!

2 Likes