Last week I gave a tutorial on how to create a quiz app using Sketchware. Maybe you want to create a more complex game and that is possible using Sketchware. Today we will be looking at creating more complex games such as an endless runner, car racing or any animated game. You could even create a 3D game but that is of you can create the graphics.
The first step is deciding what kind of game you want to create. This starts with the objective of the game, how the user will earn points, the various levels as well as customizations and upgrades. Once you have the concept you can then start building your app. This tutorial will show you how to create a game app like the one in the video below. Still needs work but I hope you get the idea.
What you will need
For a simple game app, you will need the following:
1. A sprite sheet
These are images of your various characters e.g. it can be a happy face, sad face, angry face and so on. If it's a runner, you can have them at rest and then subsequent images of them in motion. The above image shows a partial spritesheet of a game I am working on. As you can see, the runner is in different positions which when combined will make it seem like they are running.
2. Backgrounds
Depending on the nature of your app you might want to have your own custom backgrounds. If you're creating a fighting, driving or running app about 8 screens could give the illusion of movement.
3. Custom graphics
You will also want to have your own graphics(images) to use for your leaderboards, buttons and the obstacles in your game.
You can download free game kits from craftpix.netThese include all user interface elements, sprites and more.
Sketchware components
In Sketchware you can use the following components to create animation and save data.
Object Animator
this allows you to move widgets in Sketchware- it comes with the option to accelerate, decelerate, rotate, enlarge, shrink bounce and more *Timer-* this will allow you to create the illusion of a moving image by changing(rotating) different images every few seconds. It will also allow you to create a moving background. *Shared preferences-* will allow you to save scores and create a leaderboard. It will also allow you to save any other data from your app to the user's local storage. *Soundpool-* to add sounds, music and effects to your game.
Some simple app ideas
The following are some simple ideas that you could build on to create your own game. I will only explain the logic and I'm sure you'll catch the drift.
• Car Racing Game-
The above image shows the interface I built for a racing game. The main linear has an image set as the background resource. Then I used an imageview and set the image to a car sprite that I got online. The idea is that the car can either move left or right while the background changes to make it seem like its moving. As the background changes obstacles will appear and the driver has to dodge them.
• Endless runner-
These include games such as Super Mario and Temple Run. I will show you how to build an endless runner using Sketchware below, so let's skip that for now.
• Quiz App-
You can create interactive games where users answer questions and earn rewards. This can be done easily using Sketchware.
• Money/Gambling App-
using maths logic you can create numerous apps
I believe you can do so much more... Sketchware is a powerful tool and the limit is what your mind can conceive.
[TUTORIAL] HOW TO CREATE AN ENDLESS RUNNER GAME
This tutorial will cover how to create an endless runner game in Sketchware. An endless runner game is one whereby the character is on a continuous pursuit. They will be collecting points whilst avoiding numerous obstacles in their way. One common example of an endless runner game is Temple Run. This concept can be adapted and used to build your own custom game. The idea is to show you that is possible and with ease. So here goes:
What you will need
1. A Sprite sheet... this is 8 or more variations of your character in sequence. These will be used to create the illusion of continuous motion.
2. You will need images for your background
What you will need
1. A Sprite sheet... this is 8 or more variations of your character in sequence. These will be used to create the illusion of continuous motion.
2. You will need images for your background
Our game will look like in the video below. I created this with Sketchware... drew the graphics using an app called PicsArt. If you are a graphic designer, I'm sure you can create even more awesome graphics.
Creating the animation:
After adding my Sprite sheet images to sketchware, the first thing I want to do is animate the character. I will create a more block with a number variable. I will trigger the moreBlock onCreate. You can place this on your start button.
This is what will be in our moreBlock
This will change the frame and create an animation. Next, we want to move our character... so this will either move them left, right, up or down.
Moving left or right
Depending on the size of your screen, you might have to adjust the values to suit your needs. I use a tablet so my screen is bigger. You can use this logic below on your button to move left. Just reverse the values when you place them on your button to move right.
This will move the character either left or right. You can also change the logic above and use the "Translation Y" value to move up or down.
Comments
What do you mean by page2activity?
Intent intent = new Intent(MainActivity.this, Page2Activity.class);