|
Space Type 1.0
A retro typing trainer, test and game set in space
|
Word Shooter Game for Spacetype. More...
#include "spacetype_functions.c"

Functions | |
| void | text_mover (Vector2 *wordPos, Rectangle playerPos, Vector2 gap, float time) |
| Moves the word toward the player. | |
| void | game () |
| main function for game mode | |
Variables | |
Main gameplay variables | |
These variables handle different aspects related to the main gameplay. | |
| char * | words [] |
| List of words to choose from for the game. | |
| char | word [20] |
| word which is presented to type | |
| char | wordStored [20] |
| stores the presented word to later compare with fastestword and slowestword | |
| int | sizeOfArray = sizeof(words) / sizeof(words[0]) |
| for calculating total number of words*/ | |
| Vector2 | gap = {} |
| Shortest distance between word and spaceship*/. | |
| Vector2 | wordPos |
| position of word as it falls down | |
| const int | fontSize = 25 |
| Fonsize declaration for uniformity of fontsize. | |
| float | angle = 0 |
| Angle of word to have it fall towards player. | |
| float | prevAngle = 0 |
| Angle of the spaceship. | |
| float | movingPlanets = 0 |
| Denotes which planet will be on screen. | |
| float | movingDown = 0 |
| Parameters which makes space texture scroll infinitely*/. | |
| bool | GAME_OVER = false |
| boolean to check game over condition | |
Bullet related variables | |
These variables handle different aspects related to bullet which destroys the word when it is finished being typed. | |
| Sound | shoot |
| Audio played when bullet is used. | |
| Rectangle | bulletPos |
| Bullet Position. | |
| bool | bullet = false |
| indicates whether bullet needs to be shoot or not | |
| float | bulletAngle |
| Determine angle at which bullet needs to be thrown depending word position. | |
| float | bulletMover = 0 |
| To indicate speed of the bullet. | |
Extern variables from main | |
different variables initialized before needed for this portion | |
| Music | music |
| background music | |
| int | screenWidth |
| screen width for graphical operations | |
| int | screenHeight |
| screen height for graphical operations | |
| Font | retroFont |
Word Shooter Game for Spacetype.
| void game | ( | ) |
main function for game mode
Handles everything regarding spaceship shoot game. Resets variables specific to the game and general by calling reset_counter. Draws the graphics regarding spaceship falling words and bullets. Handles the gameplay mechanics and shows a gameover screen when required.
Resetting in case of new game from menu
Initialize variables and textures

| void text_mover | ( | Vector2 * | wordPos, |
| Rectangle | playerPos, | ||
| Vector2 | gap, | ||
| float | time | ||
| ) |
Moves the word toward the player.
| wordPos | Position of generated word |
| playerPos | Position of spaceship |
| gap | Shortest distance between word and spaceship |
| time | Set time for the word to hit the player |
| char* words[] |
List of words to choose from for the game.