How to make a moving platform?

I have been trying to make a moving platform for 4 hours. I got the left-right movement correct but then when I tried doing up-down movement, the player would glitch through the platform. I know why this happens but explaining why it happened would make this post too long. Anyway after that I spent 3 hours slowly turning it into a basic physics engine trying to make it so you could push boxes, so the moving platform would push the player up. Then I finally got the pushing to work and I just had to do that for the moving platform and it didn’t work. So then after that I did more research pertaining to the subject of why is Wick Editor’s error reporter so bad? Well after spending 4 minutes trying to make a thing where a user inputs a script and it gets evaluated and it also reports the line error, I realized that I have no idea how Wick Editor works anymore. Now I am baffled on how the error reporter works even 10% of the time. Please programming gods tell me your secrets.

tl;dr my attempts at making a moving platform have failed

pkplat10-6-2020_5-39-11PM.wick (5.8 KB)

looks like I’m not the only one with long replies

I’ll look through ur interesting project, though I might be no big help

I made a moving platform on my engine, but Jovanny has a moving platform that the player moves along with when the player is standing on it. You might want to find his mod to my platformer engine.

@pumpkinhead
I’m far from being a programming god, but I could put some code to accomplish what you wanted…
pkplat10-6-2020_10-33-53PM.wick (5.8 KB)

You need to have somewhere the platform velocity…
Then, when the actor collides with the MP, you set the actor Yvelocity = platform Yvelocity.

actor.yv = clip.y - this.prevY;

2 Likes

Thanks!

That’s kinda what I did first except the collision code was put in the moving platform and not the player so it works. Although when the platform isn’t moving the player sinks through the platform. I’ll change some of the code so that doesn’t happen

Also “programming gods” were referring to the Wick Editor devs

1 Like

That is why I put it in there… I’m not.

Take the compliment and run away with it before people who give it to you change their minds. :P

2 Likes

I think it’s clear that “programming gods” were referring to the Wick Editor devs if you read the sentences before that so I’m not sure why people think that “programming gods” were referring to the readers, unless you didn’t read the sentence before that and just read “Please programming gods tell me your secrets,” and connecting that with the fact that this topic is asking for help on how to make a moving platform.

2 Likes

Oh boy!!! hard crowd here… I just wanted to help, and I threw that small joke… I’m happy that could help. That’s all.

Well, even though that, my comment was accurate as well… I’m not a programming god. This doesn’t mean that you were referring to anyone… It is more from my side saying: “I’m not, but I’m willing to help.”

regarding the error reporter - you could try exporting your project to HTML, then use browser developer tools to check it over. I’ve noticed that sometimes google chrome developer tools picks up on errors that the editor doesn’t, or is at least able to offer a more accurate idea of what’s going wrong

Ex. I had a project where I originally used a variable called “roundNum”, and at some point I started using “currentRound” in place of it (for…some reason I don’t really remember). Turns out there was one single line of code that still used “roundNum” instead of “currentRound”, and wick editor didn’t report an error for it. And even though the project was able to compile and run in wick editor, as soon as I tried exporting it to HTML, it froze up right at the beginning. When I ran developer tools, it gave a “roundNum is not defined” error.

tl;dr Browser developer tools can sometimes help reveal errors that the error reporter doesn’t (or gives false reports for). Granted, this isn’t very good for pinpointing the actual location of the error…I think it’ll at least give you the name of the script it occurred in (update, mouseclick, etc) but if its a script for a certain object, I don’t think it tells you which one. But it’s a start towards debugging, I guess.

;)

12/5/24