Posts

Showing posts with the label game in Sketchware

Simple car racing android game in Sketchware

Image
To create a simple car racing game in sketchware follow the steps given below. 1. Create a new project in Sketchware. 2. In VIEW area of main.xml add a TextView textview3 for displaying score of previous game, a TextView textview4 for displaying high score, and a Button button1 for starting game. 3. In MainActivity , add a Shared Preferences component sp:sp . 4. Add onStart event and put blocks to set the text of textview3 and textview4 . 5. Create a new page page2.xml . 6. On button1 click use intent to move to page2 . 7. On page2.xml add a LinearV linear1 with padding 0 and width and height MATCH_PARENT. 8. In Page2Activity , add a Shared Preferences component sp:sp . 9. Create a number variable highscore . 10. In onCreate event of Page2Activity , use blocks to set the value of number variable highscore , and use codes to create a new GameView and add it to linear1 , as shown in image below. The code used in the add source directly bloc...