Jump to content
  • Advertisement
phil67rpg

OpenGL how do I get my sprite to move up and down once

Recommended Posts

21 minutes ago, Prototype said:

There is no progress, Phil. You haven't paid attention to anything people have suggested. Why is that?

He needs Glut specific help for delta times. I'm beginning to wonder about the people trying to help. Do any of you know Glut?

Share this post


Link to post
Share on other sites
Advertisement
57 minutes ago, fleabay said:

He needs Glut specific help for delta times. I'm beginning to wonder about the people trying to help. Do any of you know Glut?

Way back I went over how to do this using GLUT.

All you need to be able to do is get the elapsed time in order to have a working time step. 'glutGet(GLUT_ELAPSED_TIME);'

GLUT is not the proper tool here and isn't good for anyone requiring accuracy which is why it is never recommended in our day and age. Phil has been told countless times to dump GLUT as there are better options out there... ie. GLFW, SDL2, SFML

You're free to type out the answer in code or any other method for Phil to explain it better.

Share this post


Link to post
Share on other sites
1 hour ago, fleabay said:

He needs Glut specific help for delta times. I'm beginning to wonder about the people trying to help. Do any of you know Glut?

The problem is not delta times, it's the lack of basic understanding how his program works. It's useless helping someone patch a square wheel. People have taken plenty of opportunity to tell him what's wrong with it, and also that glut - being an event-based framework - inherently sucks for game development. Nothing of that ever gets reflected. Not succumbing to ones stubbornness is something different than not wanting to help.

Share this post


Link to post
Share on other sites
4 minutes ago, Prototype said:

It's useless helping someone patch a square wheel.

And yet there is a constant steady stream of nice guys ready to take up the cause.

Share this post


Link to post
Share on other sites

... yeah

Phil, although two people posted two working solutions you would only need to copy (IIRC Prototype and me), you 'fall back' to using an anlytical closed form approach to calculate jump trajectory.

As said earlier, such approach will fail if other objects collide with the player while jumping for example, because the closed form math has no konwledge of the changes caused by such unexpected events. Believe me, closed form is a dead end here.

Closed form analytics are good to do things like predicting where the jumping player will land most likely, or to calculate launch angle for a catapult to hit a target. Any kind of control problems. But not here.

For game physics simulation you want to use integration as you did before already. It deals with collisions, moving platforms, unecpected events etc. in a simple, doable way.

(The reason your character jumps only once seems you do not set time to zero when starting the next jump. The closed form formula assumes zero as the starting time of the jump.)

 

Share this post


Link to post
Share on other sites

----

Proposal: Please do Pong or Pacman first. Here physics are very simple, and it sould be much easier to figure out what problems are caused by logic / math bugs on your side, or unecpected timing issues coming from GLUT. It seems actually there is too much uncertainty to progress and learn. With Pong working, you can come back to the jump'n'run game and continue.

Share this post


Link to post
Share on other sites
5 hours ago, JoeJ said:

Closed form analytics are good to do things like predicting where the jumping player will land most likely, or to calculate launch angle for a catapult to hit a target. Any kind of control problems. But not here.

A 'helpful' video was posted by a nice guy and the damage is done.

Share this post


Link to post
Share on other sites
5 minutes ago, fleabay said:

A 'helpful' video was posted by a nice guy and the damage is done.

Yes, I posted the video as you already know so put on your grown up pants and address it. I already asked you prior when you were complaining about the video and you didn't respond. So by all means don't hold back because the "nice guy" is awaiting your response.

What Phil does or anyone else does with that information is fully up to them. I personally like the video and if you or anyone else doesn't feel the same way that is perfectly fine... Make your points, provide alternative information and be done with it. I doubt that's possible as I've seen most of your posts on these forums and they're mostly negative comments with no constructive feedback.

Instead of providing absolutely zero value to any conversation by posting snide remarks you're free to provide alternative answers instead and become a "nice guy" yourself.

Good luck!

Share this post


Link to post
Share on other sites
49 minutes ago, Rutin said:

Instead of providing absolutely zero value to any conversation by posting snide remarks you're free to provide alternative answers instead and become a "nice guy" yourself.

Last night I spent a couple of hours understanding how Glut works. If I decide to be a nice guy it won't be to put up some advanced GDC video that no beginner should ever be exposed to because I want to look like I'm doing my part. Did you even watch the video? Freaking ridiculous. And then after I point out the video is bad for a beginner you have the gall to ask, 'what's the problem with it, why so negative?' Get outta here with that bush league crap.

If I find the time I will post beginners help on how to actually get Glut to do what he needs it to do and I won't post the bare minimum "hints" that everyone seems to think are helpful or even worse some video that I did a quick search for without bothering to know what it's about.

Share this post


Link to post
Share on other sites
Just now, fleabay said:

If I find the time I will post beginners help on how to actually get Glut to do what he needs it to do and I won't post the bare minimum "hints" that everyone seems to think are helpful or even worse some video that I did a quick search for without bothering to know what it's about.

Looking forward to reading your GLUT tutorial. Best of luck. 👍

Share this post


Link to post
Share on other sites
Guest
This topic is now closed to further replies.

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!