Re: Jumping in 2d games in bgt?

2020-06-03 Thread AudioGames . net Forum — Developers room : amerikranian via Audiogames-reflector


  


Re: Jumping in 2d games in bgt?

There are multiple ways of doing this, each with their own advantages and, naturally, disadvantages.  The simplest? Ask yourself what happens when you jump. How do you know that you are going to land. How does the game know that you are going to land.  You will have your necessary variables when you figure out the answer. Then it’s just a matter of creating different Boolean’s for jumping, falling, landing, etc. You can even combine some of them into an integer, such as zero for jumping, one for landing, etc. That is the simplest, but not the best way.  The reason why is because you will have to keep track of all those variables when writing if statements. What if you want the player to do a special attack when they are jumping, but not when ducking. What if you want the player to be able to slide on the ground when they duck, but not while they’re walking. Your code gets really messy if you take this approach. For simple projects, however, this is the easiest, if not the most clean solution.  A different way is to make each thing its own separate state. If you don’t know what state is, I suggest googling game programming patterns and reading up on state machines, it has a great introduction with its own list of pros and cons to using the pattern. This is more complicated, but ultimately it allows you to do much greater things than if you just use booleans and integers.  The code sample is in C++, but the advantage that you have is that you already know a good chunk of the language. Don’t concern yourself with pointers or anything if the examples use them, the main idea is in how the code is presented.  Also, this is a valid question. It’s not stupid, in fact I believe that these kinds of questions should be asked more often primarily because open source stuff implements the logic quite messily if I do say so myself.

URL: https://forum.audiogames.net/post/536756/#p536756




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Re: Jumping in 2d games in bgt?

2020-06-03 Thread AudioGames . net Forum — Developers room : Zarvox via Audiogames-reflector


  


Re: Jumping in 2d games in bgt?

I don’t know jumping either

URL: https://forum.audiogames.net/post/536687/#p536687




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector


Jumping in 2d games in bgt?

2020-06-03 Thread AudioGames . net Forum — Developers room : tunmi13 via Audiogames-reflector


  


Jumping in 2d games in bgt?

Hi,I was wondering the best way to implement jumping in a sidescroller? As some of you probably already know, I've never made a sidescroller, at least, not one with jumping support. I tried making a method but ended up failing on a level of stupidity. In fact I probably might be stupid asking this right now because people probably already know how to do this. However, any sort of help, even just a little, would be appreciated.Thanks.

URL: https://forum.audiogames.net/post/536675/#p536675




-- 
Audiogames-reflector mailing list
Audiogames-reflector@sabahattin-gucukoglu.com
https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector