This step is going to be similar to step 4 but it will be slightly different as it is for the Warlock as opposed to the Knight which means we will definetely alter the code.
The first step is obviously going to be coding the magic shield which is the Warlocks defense feature.
This will be the Warlocks magic shield and he will use this the same way as the knight. obviously its function is to completely repel the knights attacks so that the Warlock does not take any damage and so the Warlock can prepare for a counter attack.
The code for the shield is pretty simple,
This code will do many things first off it will hide the Magic shield and set it to the correct size as soon as the game is started. Next when the player presses x it will broadcast delete which is just used to ensure the shield does not create 2 of itself, then it will show itself for 1 second and then hide itself once again. And at the very end to ensure that it cannot be spammed I added a 0.5 second cool down. Finally if it touches the knights wind/ defense break it will immediately hide itself allowing the Knight to attack.
Now that we know the functions of the shield we can move on to the defense break. Just like the other defense break the code will be slightly harder than shield code as it serves a more advanced and complicated purpose.
I figured it would be interesting to have winds for both defense breaks but I realized that I would have to make the Warlocks fire wind look unique and different from the Knights wind so I made it into fire wind. Next up we have to code this sprite.
Putting in to consideration that this shield break is almost identical to the Knights shield break I think it is best if we skip over the basic functions and talk about the more important aspects of the game and these functions.
All the main functions of the game are completed so now we have a couple things left before this game becomes fully functional as well as some optional/additional finishing touches.
The main things that we have left to include:
Adding multiple backgrounds
Adding death animations for both characters*
Adding damage animations for both characters*
Adding all necessary variables
Adding some extra sound effects*
Adding a power up*
All things on the list with an * next to them are optional but I personally recommend adding them as they really help complete the game.
That is going to be it for this blog thank you for reading if you have any questions email me @email@example.com And Sub to my YT channel @Drago Gaming link below: youtube.com/channel/UCrlNUqQVBxLIbdltHQBdcYg
Sorry for some reason the link will not become a link so you will have to copy and paste it for it to work. Sorry about this inconvenience hopefully I will be able to fix it in the future.
In my last post I explained how to program a sprite to move around in a game. Today I will be showing you how to change the speed of the sprite and how to change and add costumes let’s get started.
To change the speed of the sprite you simply have to decrease the amount that the x and y position of the sprite are changing. For example if my sprite is moving by 10 x each time the right arrow is pressed then to slow the sprite down we have to make the sprite only move 7 x each time the right arrow is clicked.
Next I will go over how to add a starting position for your sprite. To do this you have to drag out a block that says go to and has an x and a y input.
Now from personal experience in making countless games I know that there are usually only 3 places that a sprite starts at. Location 1 is the bottom of the screen also known as the edge of the screen. Location 2 is the left hand side of the screen usually in the middle. And Location 3 is at 0,0 or the dead center of the screen.
To make the sprite go to one of these 3 main locations we use the go to block and we insert it into our code we had from my last post. Since I want my sprite in the middle of the screen I will have the coordinates in the go to block at 0,0.
Finally I will be showing you how to change and add costumes in your game to make it visually pleasing. To do this we will add another (if then) block to our code as well as a (key space pressed?) block and finally we will add a (next costume) block. This will change the costume of scratch cat into a wizard but we have to add a (wait 1 second) block to make the change smooth.
After we add all this code it will look like this. Once again thank’s to everybody who read this entire blog entry and please comment any tips or ideas that you want to see me post about and make sure to include your real name or your scratch name. And make sure to check back soon for my next post which will include the start of making one of my all time favorite games 2 player battler simulator
Now that I have touched base on the basic scratch terminology I can show you how to start coding your sprites to move, think, and talk! When you start a new project on scratch there will only be one sprite loaded in and it will be a waving cat known as Scratch Cat.
Once the project has loaded you can go to one of the three tabs on the top left of your screen labeled Code, Costumes, and Sounds. Those tabs are where the magic happens in Code you insert blocks of code and connect them to a Green flag block. In the costume tab you design costumes fro your sprites as well as your backgrounds. Finally we have the Sound tab where we can add sounds to anything a sprite does to make the game more entertaining.
Now that you know these basics we can get started on coding some movement scripts. First of all you want to start by dragging a Flag Block from the left hand side of your screen, next you should drag out a block that says forever because without this block the code will only repeat once and the game will not function.
After which we will add 4 blocks that say “if ___ then” on them with a big hole in the middle. If I were to fill the blank with another block then I could put command blocks inside the “if___ then” block to tell the sprite how to react.
Once we added the “If___ then blocks” we will put in an” key right arrow pressed?” inside the first “If____ then block.” And for the second block we put in a “key left arrow pressed?” For the third block we put in “key down arrow pressed?” Finally in the fourth “If____ then block” we will add “key up arrow pressed?”
For the next step we will get a “change x by 10 block” into our “If____ then block” by simply dragging it into the correct block. “The change x by 10” goes in block number one. The change x by -10 goes in block two. The change y by -10 goes in block three. Lastly The change y by 10 goes in block 4.
Now if you did all the steps correctly the game should be flowing smoothly. Thanks for sticking to the end of this blog entry and stay posted for another one in 2 weeks!!!
In this blog entry I will be showing you a sneak peek at one of my latest games called 2 Player Battle Simulator. In this game you and a friend can battle it out using your choice of either a Warlock or a Knight. You can move your character, throw up a shield, shoot an attack, or destroy an enemy shield. In the end there is an awesome animation where you can watch as your enemy turns to dust at your feet and you will get glorious bragging rights.
For any new coder learning the terminology for coding on scratch is crucial. In this article, I’ll be explaining what various aspects of a game on Scratch are. These will include: Sprites, costumes, stages, and command blocks.
Allow me to start by explaining what a sprite is. A sprite is any character or object in a game that moves or does any actions whatsoever. They are important because no game can be made without sprites. Sprites can be drawn or uploaded. Scratch has a costume creator which allows you to draw your own sprites. Uploaded sprites can come from any google image (they must be downloaded to the computer and then uploaded on Scratch).
Another important aspect of Scratch are costumes. The appearance of a sprite is called a costume. Costumes give sprites their shape, form, and color. Costumes have an added benefit of making the game visually appeasing. Costumes can be anything drawn or uploaded from your computer. Lastly, costumes can be replaced and there can be multiple costumes on a single sprite.
Stages, also known as backdrops, are the background for a game. They can be customized like costumes and can be any shape, form, or color. Stages can also be drawn and uploaded from your computer just like sprites. The reason why stages are important is because they are the first thing that catches the eye of the player. Oftentimes, this first impression can determine whether or not someone will play your game. Stages can also set the mood for your game and can be made to move for a more immersing experience.
The final Scratch terminology that will be covered are command blocks. Command blocks are color coded blocks that dictate how the game plays. They control everything from a sprite’s movement, emotes, and costume changes to stage changes and game events such as win or loss cases (the requirement that must be met to win or lose a game).
With the knowledge/understanding of the main terminology behind Scratch, anyone can make an amazing game.
Hello and Welcome! Thanks for visiting my coding blog! Here you will find lots of interesting and enjoyable posts on how to create games on the coding website Scratch. All of my tutorials will include pictures to help build a visually pleasing display. In addition, they will include a play by play on all the steps to code various types of games.