top of page

Space Survival

A Star Wars inspired scratch game where you engage in epic space battles against enemy spaceships.

How to Play

​In this game, you control a spaceship and battle enemy ships in space. Use the A and D keys to move left and right, and the Spacebar to fire lasers. You begin with 3 lives, and every time an enemy ship collides with you, you lose a life. The game ends when all your lives are gone.

 

If you destroy enough enemy ships, you'll advance to Level 2, where you'll have the option to choose between two powerful abilities: one boosts your fire rate, while the other grants you extra lives. After selecting your ability, you'll face even more enemies. Keep defeating enemy ships in Level 2, and if you manage to destroy enough, you'll win.

How it Works

At the start of the game, one enemy spaceship clones itself and hides. Each clone is teleported to a random X position, while the Y position remains the same, ensuring all clones spawn at the same height. The clones then gradually move downwards using a forever loop and a change Y block.

​

When the player fires a laser, there is a cooldown between each shot that is controlled using a variable. If the laser hits an enemy spaceship,  the spaceship will explode and the laser disappears. This is coded using a forever block combined with an if-then block.

​

If an enemy spaceship collides with the player's spaceship, the enemy spaceship explodes, and the player's lives decrease by 1, which is also coded using a forever block and an if-then block.

Each time the player destroys an enemy spaceship, a hidden variable increases by 1. Once this hidden variable reaches 10, the program changes the background, hides all current sprites, and shows two new sprites that are the abilities.

​

If the player chooses the increased fire rate ability, the fire rate cooldown variable between attacks will be reduced, allowing the player to shoot lasers faster. Alternatively, if the player selects the gain lives ability, the live variable is increased. After an ability is chosen, the background returns to space, and an enemy clone cooldown variable (the delay between each clone's creation) is decreased, causing the enemy spaceships to spawn more quickly.

​

Upon defeating enough enemy spaceships in the second level, the program will hide all sprites and display a victory message, indicating that the player has successfully survived and won.

Learning Journey

When I was younger, I loved watching Star Wars with my dad. After we finished watching all the movies together, I was so inspired that I decided to create a Star Wars game on Scratch. I downloaded a spaceship, a laser, and an outer-space background, and began coding. Once I had the shooting and movement functions working, I added variables for lives and a score.

 

Although I enjoyed playing the game, it eventually started to feel quite boring. I knew I had to introduce something new to keep things interesting. Remembering the cool power-ups I could unlock in other video games, I decided to add abilities. I also reduced the time between enemy spaceship clones after surviving Level 1, making the game more challenging.

​

Adding these new features brought multiple bugs, but I was determined to fix them. After a few days of hard work and problem-solving, I finally fixed all the issues. When I played the completed game with my dad, we had lots of fun.

As I gain more experience as a coder, I plan to add even more abilities and maybe even a final boss!

AR Ping Pong

A fun scratch ping pong game involving augmented reality and video sensing

How to Play

Scratch AR Ping Pong is an exciting 1v1 augmented reality game that detects movement through your camera. The objective is to outscore your opponent by the end of the round.

 

You can score points by using your hand to hit the ping pong ball into the enemy's goal zone. You can also defend your own goal zone by blocking the ping pong ball with your hand. 

How it Works

The project utilizes the Video Sensing extension to track the player's hand movements. When the green flag is clicked, a variable named Speed is initialized to 5. Whenever the “video motion on sprite” block detects motion greater than 5, the speed adjusts to match the value of the block. The direction of the ball is also set according to the “video direction on sprite” block once the speed surpasses 5.

Each time the ball hits one of the goal zones, a “Collect” sound effect plays, and the opposing team's score increases by 1. Additionally, there are two variables: Time Stopper and Time. When the green flag is clicked, Time Stopper is set to 1 and Time is set to 60. Each second Time Stopper remains at 1, the Time variable decreases by 1. When Time reaches less than 0, Time Stopper is set to 0, stopping Time from decreasing.

Once the time runs out, a “Bell Toll” sound effect plays, and all variables are hidden. The backdrop changes to a "Time’s Up" screen, followed by another backdrop displaying the winner. If the BlueTeamScore is higher than the RedTeamScore, the backdrop will show that Blue Team won. If the RedTeamScore is higher than the BlueTeamScore, the backdrop will show that Red Team won. In the case of a tie, the backdrop will indicate a draw.

 
Whenever the ball hits one of the goal zones, a “Collect” sound effect will be played and the opposite team’s score willIncrease by 1. There is also a Time Stopper variable and a Time variable. When the green flag is clicked, Time Stopper is set to 1.Every second Time Stopper is set to 1, Time decreases by 1. Once Time is less than 0, Time Stopper is set to 0, which stops Time from decreasing.

 Afterwards, a “Bell Toll” sound effect will be played and all variables become hidden. The backdrop will then be changed to a times up backdrop, and then to a backdrop showing who won. If the BlueTeamScore variable is higher than the RedTeamScore variable, the backdrop will be switched to show that Blue Team won. If the RedTeamScore is higher than the BlueTeamScore, the backdrop will be switched to show that Red Team won. And if the BlueTeamScore variable is equal to the RedTeamScore variable, the backdrop will be switched to show that it was a tie.

Learning Journey

After I mastered using Scratch, I wanted to explore more advanced features by experimenting with extensions. The Video Sensing extension caught my attention as it looked very interesting, so I decided to give it a try and see what type of game I could create. 

As I played around with the different things you can do with the Video Sensing extension, I thought of making a ping pong game for fun. The idea of using hand movements to control the game seemed exciting. However, adjusting the ball's speed based on augmented hand movement was a bit challenging since I wasn't very familiar with how to use Video Sensing. I tried many times and had several failed attempts, but I didn't give up. After a lot of perseverance, I finally managed to figure it out.

The rest of the programming was mostly straightforward, although I did encounter a glitch with the timer. To fix this issue, I added the Time Stopper variable, which resolved the problem. It felt so nice to see my game working relatively smoothly after overcoming these challenges.

In the future, I hope to add more features to my ping pong game. One idea is to set a maximum speed for the ball's movement to make the game less repetitive and more exciting. I am also thinking of adding multiple rounds to the game, to make the game more intense in a way.

Created by Caesar D'Angelo

bottom of page