User Tools

Site Tools


notes:comporg:spring2024:projects:mpg0

This is an old revision of the document!


MPG0

References

The Vircon32: C API reference page may be helpful - http://www.vircon32.com/api.html

Game Mechanics

Game loop

Sprites

  • There should be a sprite for at least a background, the snake's body and the food if you want to make your snake just a normal looking square.
  • Some good free sprite software's would be GIMP , Microsoft Paint, or maybe even Photoshop on a school computer.
  • A link to GIMP download: https://www.gimp.org/downloads/
  • You could also have a death screen for when your snake dies.

Gamepad input

There is obviously your arrow key inputs but there are other buttons available as well. At least for gamepad(0) we have button_?_ = ? for the average keyboard:

  • A = X
  • B = Z
  • X = S
  • Y = A
  • L = W
  • R = W
  • Start = Enter Key

When making you gamepad you'll make gamepad_direction values, WalkX and WalkY for example purposes.

  • If WalkX < 0 then that mean you're going left.
  • If WalkX > 0 then that mean you're going right.
  • If WalkY < 0 then that mean you're going up.
  • If WalkY > 0 then that mean you're going down.

With those you would probably make it so that when WalkX < 0 var = 1. And then do:

if( var == 1 ) {
  Snake.X -= PlayerSpeed;
}

to make your snake constantly move after pressing an arrow key.

Bounds checking

Handling motion

Score Display

you need the string.h header file

make a variable for the score

make an array to display the score

use the itoa function to convert the data, then use the print_at function to print it on the screen.

you can use the Vircon32 tutorials as a guide to help build and display the strings: https://github.com/vircon32/ConsoleSoftware/tree/main/Tutorials/WritingText

notes/comporg/spring2024/projects/mpg0.1707104674.txt.gz · Last modified: 2024/02/05 03:44 by jbernata