Birdman Development Diary: the foundations

10 February 2018

Categories: C++ | ASGE

Field Of View

To implement field of view, I created a sprite (fov) which is to be attached to the player sprite. When it is NOT colliding with Birdman, a bar (part of the UI) will decrease. Once that bar reaches zero it's game over, so the the player can only look away from Birdman for a set amount of time.

Collisions with walls

If we were to implement collision using the same above if-statement for each wall within a level, there would be a lot of walls to render! This would be costly on performance, so an alternative I came up with was visualising the level as a series of 1's and 0's (pardon the programming pun). Essentially, all of the walls would be represented as a 0, and empty places (a.k.a. where the player can go) as 1.

  • Enlarge image
  • Enlarge image

By having this level in a text file, I can read this in and create a vector which checks each tick if the player is in a valid position. The visuals of the level will be adjusted when the core functionality of the game has been implemented