Document.png Please expand this article or section. You can help by adding more information if you are an editor. More information might be found in a section of the talk page. (December 2020)

This tutorial features an endless basic shooting game.

Plan

Before starting to build the game, here's a plan that will be followed:

  • Fire bullets when the mouse is down.
  • Shapes will grant the player an amount of points upon destruction.
  • Zombies will spawn, which take damage from bullets. A zombie will dissapear from the screen when its health is depleted.
  • Allow the player to buy new weapons, and equip them and previous weapons.
  • Increase the difficulty as the game progresses.
  • Display important variables to the player using a text-based number display.

Before starting development, create 4 sprites: player, zombies, weapons, and store

The Player

For the player, a smooth movement script will be used. The player will always point toward the mouse pointer. The variables player.xv, and player.yv can be global variables, but if made as for the sprite only, they must be made in the sprite.

when flag clicked
set [player.xv v] to (0)
set [player.yv v] to (0)
go to x:(0) y:(0)
forever
	change [player.xv v] by ((<<key (right arrow v) pressed?> or <key (d v) pressed?>> - <<key (left arrow v) pressed?> or <key (a v) pressed?>>) * (0.5))
	change [player.xv v] by ((<<key (up arrow v) pressed?> or <key (w v) pressed?>> - <<key (down arrow v) pressed?> or <key (s v) pressed?>>) * (0.5))
	set [player.xv v] to ((player.xv) * (0.85))
	set [player.xv v] to ((player.yv) * (0.85))
	change x by (player.xv)
	change y by (player.yv)
	if on edge, bounce //Make sure to put this before the point block.
	point towards (mouse-pointer v)

Examples

Here is an example of a game built with this tutorial:

  • [[[projects:466911822/embed]] Example 1]
    Note Note: Additional material has been added by the game's creator beyond what is in this tutorial.
Cookies help us deliver our services. By using our services, you agree to our use of cookies.