Now that you have an action game, if you want to put it on your Android, some changes have to be made. Sizing it to your Cellphone Screen First is the screen size. Since there are so many screen sizes, LiveCode has a function to adjust the stack/card size to the device it is running on. Add the following code to your "Stack Script" (On the LiveCode Editbar, click on ""Object", then click on "Stack Script" and paste the following handler:
Adding new Controls (Arrow Keys) Cell phones do not usually have separate arrow keys, much less keyboards. So we have to add arrow keys on the screen. We can use some of the code from the card script: On the card, we had for the "UP" arrow key:
leave that there but copy and paste the code into the button script:
Then below that add the "on mouseStillDown" message and paste it in there too ( so that you can hold down the "up" key and the player will keep moving:
So now it looks like this: Now do the same for the other keys.... note: I got tired typing, so I created another message "ckfin" (to check if I crossed the finish line after I moved) So I put the code in a message "ckfin", put it on the card script and call it from every key that moves the player. Add that code to the card script (see below) Add the following message handler to the Card Script for the finish Line
Going to Another Level When you go to another level, you need to stop the current level ("put false into gameOn" or whatever you called your variable/flag). Add the following message handler to the Card Script for the finish Line
|
App Programming >

