Can anyone help me with this problem?

this game isnt fully develop yet but its playable now, u guys can play it if u want
i want my game to be playable on mobile so i decided to do buttons as movement instead of keys

im having a trouble when my game was played in mobile and it comes to the questions scenes the selection buttons there dont respond and its the same with the Game over scene which is the “play again” button but when played on pc it was okay

is there any mistakes that i did in my code ? or i need to put some more codes to make my game playable in mobiles like how the way game respond when played on pc?

Can you post a screenshot of the events that control the question and “play again” buttons? I see the button depresses then I tap it on my phone or laptop, so it does register it.


this is my code in the [Question] scenes i named my game over scene as a [lOst]
also i have 10 scenes and they are the same code as this :

and this is my code in the game over scene

i named the [play again] button as “ply

Instead of using “Left mouse was released” use an inverted “Touch or Left mouse button is down”.

1 Like

OH, it works, thanks a much.

i have one problem again hehe, when played it in mobile its like there’s a invisible line that when the snake go there even it is not on screen edges the snake dies resulting the scene changing to the game over scene, how can i fix this?

this is the code i used

Which direction is the snake travelling?

BTW, your last event of the screen shot is a copy and paste error. Y position should be set to ScreenHeight() - Head.Height().

1 Like

the snake travel downwards

Then fix that last event of your screen shot. It’s probably causing the invisible line bug.

1 Like

i already fix the:

and fix my width and height according to the game H&W resolution but it still persist

when I play it in pc it don’t occurs but when played in mobile its always there

Place a temporary text box on the game screen, and set the text ToString(ScreenHeight()) to see what the actual height is.

1 Like

it shows here that my height is : 276 and my width is: 720
(in mobile)

but in pc the size is w(720) and h(1584)

what should i do next?
I’m sorry if i ask multiple times I’m just new in gdevelop and i was desperate to finish it already ಥ⁠‿⁠ಥ

Personally I would place a hidden object around the outside of the screen, even a stretched 1 pixel thick sprite. Upon collision with that border sprite use the separate objects action in addition to the stop forces: