From pc build to android will that change the codes as well?

Do i have to write different code to replace the mouse position code if i were doing this for a mobile game? can i just write the codes as in here for pc moving the paddle by moving mouse then later on change the build to android will that automatically convert the code to something that instead of mouse will make it touch based ? i know i have to install android sdk jdk these stuff my concern is with codes ?

Hi Mustafa,

That’s very likely because a) you don’t have a mouse on your phone, and b) your phone probably has a different aspect ratio than 4:3.

Instead of a mouse or a finger, you could use the accelerometer input of your mobile device. You can find a lot of tutorials on youtube, e.g. this one.

Hopefully, this helped. :slight_smile:

hello , so just taking care of input and aspect ratio will take care of the android platform ?

I don’t know. You’ll have to test your game. A few students built their Block Breaker game successfully to Android. They started programming with our course, so I doubt they had to change a lot to make their game work on Android.

You could try to build your game as it is and run it. Then you’ll see if there is something you need to adjust.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.