Code Help

Examples of Games

We have collected and created some insect games which show how you can put it all together:

  • Simple game = a simple game style suitable for beginners
  • Medium game = a medium complex game suitable for people with experience
  • Complex game = a complex game suitable for people with a lot of experience or who has just completed are learning course


Movement

Movement is at the heart of all games. In these code snippets we will take you through simple key movements from:

  • Simple movement = moving up, down, left, right using keys
  • Following the mouse pointer = making the sprite move in the direction of the mouse
  • Auto random = random movement
  • Adjustable Speed = where you can change the speed throughout the game
  • Jumping = jumping a height off the ground while moving forward
  • Ask an expert = if you need other code snippets we will do our best to help you

Eating

Eating is what powers the insects, it adds to their health. Unfortunately sometimes it poisons them. Here are some useful code snippets:

  • Eating good = eating food that adds to health points
  • Eating bad = eating food which poisons the insects. There are two parts, generating the insecticide / poison, and getting it to damage the insect.
  • Ask an expert = if you need other code snippets we will do our best to help you

Predation

It is hard world out their for insects and they are often being eaten or damaged:

  • Death = being eaten and losing a life
  • Damage = being damaged by a predator or hazard
  • Ask an expert = if you need other code snippets we will do our best to help you

Variables

Variables are how we record interactions in games. This involves speed, health, population numbers, wining and losing decisions. Here are some useful code snippets:

  • Setting Up Variables = How to set up variables
  • Speed Variables = How to use variables to control speed of movement
  • Losing Variables = how variables are used to decide losing
  • Winning Variables = how variables are used to decide winning
  • Population Variables – counting populations
  • Ask an expert = if you need other code snippets we will do our best to help you


Special Skills

Many insects are like super heroes’ who have special skills. We have tried to create some of these special skills:


Scroll to Top