Space Type 1.0 A retro typing trainer, test and game set in space

Loading...
Searching...
No Matches
Functions
spacetype_functions.c File Reference

Created functions for this application. More...

`#include <string.h>`
`#include "spacetype_functions.h"`
Include dependency graph for spacetype_functions.c:
This graph shows which files directly or indirectly include this file:

## Functions
void | remove_firstletter (char word[])
| Removes the first letter of the word sent.
void | draw_background ()
| Draws background in all modes.
void | reset_counter ()
| resets variables for required statistics
void | pause_screen ()
| Creates a pause menu.
void | keyboard_highlight (char a)
| hightlights requried letter
void | tutorial_screen ()
| Shows a tutorial screeen for touch typing.

## Variables
Statistics variables
variables handle counters which are associated with with statistics of Word shooter game and word train mode.
char | fastestWord [20]
char | slowestWord [20]
char | scoreString [50]
int | SCORE
float | TIME = 10
float | planetTime = 0
float | keysPressed
float | rightKeysPressed
float | framesCounterForSession
float | framesCounterForWord
float | fastestWordFrames
float | slowestWordFrames
bool | gapMeasured
bool | exitPause = true
Background and main interface variables
handle different elements related to main interface of the program like background textures, music, scale, etc
float | scale
| Image scale for the uniformity.
float | movingDown
| Variable to govern infinitely scrolling background.
float | movingPlanets
| Variable to govern moving planets.
float | mover
| Variable which controls the speed of the word in game mode.
Music | music
| background music
Texture2D | spaceTexture
| Space Background used in infinite scroll background.
Texture2D | planetTextures [3]
| Array of 3 different planet images to display on background.
Texture2D | bulletTexture
| Texture of Bullet used in game mode.
Texture2D | spaceshipTexture
| Texture of spaceship in game mode.
Texture2D | cockpitTextureKeyboard
| Background Texture.
Extern variables from main
different variables initialized before needed for this portion
int | screenWidth
| screen width for graphical operations
int | screenHeight
| screen height for graphical operations
Font | retroFont
bool | exitGame
| To govern game mode loop.
bool | sorted
FILE * | wrongChars
| To store mispressed characters to use in customized train mode.
Texture2D | qwertyTexture
| keyboard image for tutorial screen

## Detailed Description

Created functions for this application.

Author
  Praharsha Adhikari 078bc.nosp@m.t061.nosp@m..prah.nosp@m.arsh.nosp@m.a@pca.nosp@m.mpus.nosp@m..edu..nosp@m.np

Bug:
  No Known Bugs

## Function Documentation

## ◆ draw_background()

void draw_background | ( |  | ) |

Draws background in all modes.

Draws the infinitely scrolling space background with moving planets.

## ◆ keyboard_highlight()

void keyboard_highlight | ( | char | a | ) |

hightlights requried letter

the key you need to press in the keyboard for Train mode

Parameters

  a | the letter which needs to be highlighted

## ◆ pause_screen()

void pause_screen | ( |  | ) |

Creates a pause menu.

a pause menu when called. Has options to either resume the game or return back to main menu

## ◆ remove_firstletter()

void remove_firstletter | ( | char | word[] | ) |

Removes the first letter of the word sent.

Parameters

  word[] | the word sent to have its first letter removed

## ◆ reset_counter()

void reset_counter | ( |  | ) |

resets variables for required statistics

all the variables like score, fastestword, slowest word, etc. that are used to calculate statistics during word practice and Game mode

## ◆ tutorial_screen()

void tutorial_screen | ( |  | ) |

Shows a tutorial screeen for touch typing.

Shows the touch typing finger placement in keyboard when Help button is pressed in main menu

Here is the call graph for this function: