Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

anhskrttt/UETSnakeProj

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 

Repository files navigation

SnakeHead

So I decided to make an interesting game Snake - yes, i mean, the typical one, the "Snake", but then, there were a few problems that the snake's tails did't move, so here i'm introducing, the total new version of Snake : SNAKE-HEAD. Enjoy it, tadaaaa :>

UPDATE <Since 05/2020>

1. New README

2. New comment:


  • cmt1

  • cmt2

  • cmt3

3. New ending background (Press any key to restart -> Press r to restart):

  • Before:
    OldendBackground
  • After:
    endBackground

4. Replay: Press r to change status from endBackground(2) to startBackground(0)


  • replay

5. Change loadImage function of PlayerObject:

  • Before:
    LoadImageOld
  • After:
    loadImage

6. free ThreatObjects used (the game object that inherits from BaseObject) :


  • freeThreatObject

Reference Source

Features, Coding Style and Deployment

  • A menu start and a menu end
  • Press any key to start. Replay by pressing r
  • Different music in the end
  • Effect sound: collect coin, touch enemies
  • Enemies choose random directions ()
  • Count point
  • Different spritesheets for different directions (left, right)
  • main.cpp is easy to follow (init -> loadMedia -> (game-loop(handleEvent->update->render)) -> end)
  • Implementing inheritance, virtual function ()
  • Seperated files for different purposes
  • Utils.h storing: (preprocessor directive), (basic properties of the game (which are constant values)) and (functions that commonly used)
  • (Resource File) storing resources in game (media, map, font)
  • Implementing lessons learnt: reading files (using fstream), using pointers (in order to save memory, optimize proj), using class, ...

Getting Started

This is a really simple game to play!

  • press any key to start
  • using your arrow keys,
  • control a snake,
  • try to collect coin and strawberry,
  • avoid touching border and enemies
  • press r to replay

Prerequisites

SDL version 2.0.12 including:

- SDL2
- SDL2_image
- SDL2_mixer
- SDL2_ttf

Running the tests

Check my youtube channel for the demo of the game: https://www.youtube.com/watch?v=BpjX6KBRW_c

Built With

  • SDL2 - The cross-platform development library used
  • C++ - Language used

Authors

License

Open source

Acknowledgments

  • Updating optimization
  • Updating the high score
  • Not really creative

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages