My game was working fine except for audio delay until I made my next level. The keyboard controlled level 2 works fine but the touch screen level sends the player up in a continuous jump when it is launched. So I moved the level I was having difficulty with up to the top scene so that I could test it immediately on my mobile device. When I move it t the top it works fine but if I move it back down the issue with the player jumping begins again. I cleaned the screen thoroughly and the issue does not occur on the first level. I cannot see anything different in the coding for the second level. Anyone have any ideas on what to look for. Are there any weird glitches on the Ubuntu version of Gdevelop?
I found the issue. I had an overlapping object affecting the touch screen control although neither of the objects was in contact with a touch or cursor. Fixed that and added a deactivate mouse cursor move on touch and it now works. I also had to set trigger once on the prevoius menu to completly fix the issue.
The overlap actually was not the issue in fact this problem is very random and will pop up after I think it has been resolved. I have tried a number of things such as trigger once which actually made it worse, adding touch held which helped but did not completely remove the issue and using the minification on export. I think what we have is a glitch with the gaming engine itself. If anyone knows of a fix to keep multiple jumps from happening on touch screen I would love to hear from you. In the meantine I will move on to another engine.
I got to wondering if the issue could be with my browser or the server I was using for the html5 file so I made a Android Package. Unfortunately the issue still persists but it is now very rare. I ran numerous test of the game and got two instances out of 150 test runs. Also when the issue would occur while running from the browser it would then happen more and more regularly whereas the issue is rare and goes away after restarting the program when the android package install has the multiple jumps. So I still do not know what is causing this but thought I would share that information. At l east it is working to a reasonable degree with the android package. I also do not have this problem with the keyboard control of the game only on the touch screen and only when a new level is launched.
Sorry, I haven’t replied before because I can’t help a lot, I don’t use GD for touchscreens devices, but maybe a screenshot from your events can bring the help from an experienced user
I have multiple screenshots for the events. Here is a link to my google drive.
Try to also check if the player is on the floor before jump.
The cursor/touch is on newObject10
Touch or Left mouse button is down
Player is on the floor
Simulate pressing jump key for Player[/code]
This way the action should be triggered only once when the player is on the floor.
When the player is in the air (falling or jumping doesn’t matter) it should be unable to jump until touch the floor again.
But the fact you are experiencing the problem only if the scene is the second scene sounds to be a bug to me.
Do you experience the problem also if you preview in the browser (Firefox) and use the mouse?
I have just noticed you also make the player jump when it is falling on to a “Bad”. And you allow the player to jump again while it in the air.
In case my first suggestion doesn’t solve the problem, in case this “Bad” is not a platform, make it to be a platform and instead of allow multiple jump in the air and check if the player is falling on to the bad try this:
Player is in collision with Bad
Player is on the Floor
Simulate pressing jump key for Player
When the player touch the Bad it should also be on the floor, so no longer jumping or falling and you should be able to make the player jump again without allow multiple jumps in the air. But I believe collision check is not going to work here, you going to need a sprite, slightly bigger then the player, in same position as the player and technically use this sprite as a collision box for the player and to check collision.
So the condition need to look like this:
player_collision_sprite is in Collision with Bad
Player is on Floor
EDIT:// ok, I have just realized you may want to make the player jump only when it falling on to the top of the bed, to make it work with my suggestion, use an invisible sprite as collision box on the top of the bed, make this collision box a platform and make the player jump when it colliding with this collision box. This way, it should make the player jump only, when the player is colliding with this box on the top of the bed.
But in case you just don’t want to mess the bed jump up with my suggestion, just simply disable this event to make sure it is not the one that causing the problem. In case you disable it and you no longer experience the problem, you just found the source.
The issue does occur in different browsers but is less likely to trigger with mouse.
Regarding the multiple jump, I would have to tweak the game design a lot to remove the ability to jump again. The ability to jump in the air is set because the game is set in an underwater scene. So the player is able to run jump and swim around obstacles with gameplay being a cross between platform and flappy bird.
The jump coding could have something to do with it but I’m not sure since it will only happen at beginning of the scene but never during gameplay.