Skip to content

S4ltF1sh/RocketLauncher-Game-CPP

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 

Repository files navigation

RocketLauncher Game C++

This is my little game that uses the SFML library.

RocketLauncher folder is the folder containing the project running on Visual Studio.

testCPP.cpp file is the code I wrote to convert a 1-dimensional array to a matrix for map drawing (you can read about my map creation below)

This game only has 8 levels and it will probably be updated depending on my mood :D

This game has 1 easter egg, try to find it :>

You can adjust level and total number of deaths in Map.txt. image

How to create map

Step 1:

_I use tiled to draw the map as I want, to do this I need a game asset:

I used: https://pixelfrog-assets.itch.io/pixel-adventure-1 _ //I designed the rocket myself :D

_To use Tiled easily, you can refer to some instructions:

https://doc.mapeditor.org/en/stable/manual/introduction/#getting-started //Getting started with Tiled.

https://doc.mapeditor.org/en/stable/manual/terrain/ //How to use terrain sets.

image

Step 2:

_I save the map file as json.

_And then Open the saved json file and copy data from the array "data" in that file. image

_And paste that data into the array section in TestCPP.cpp, run the code and it will help you convert the data just now into matrix form. image

//You can change the number of row and col depending on the number of tiles in your map.

image

//Here is the conversion code I wrote and I got confused between rows and columns (You can see in the game code I had to invert the row and column values).

image

//You can rewrite another conversion code that works for you (note that the Ox and Oy axes in SFML are reversed to Cartesian coordinate system)

Step 3:

_Copy the result that the conversion code prints out and save it to a file so that when the game loads, you will open that file and get the data from it. image

image

//load data from Map.txt file: image

//I draw the map based on the name of map's pieces. Each piece will have different functions,

//for example Trap and Block are 2 different types and they will be divided into 2 different classes and saved to the Map. image image

_You can modify each map by modifying the Map files in the folder MapForm by following name of map's pieces in folder Wibu time!\Wibu time!\Data\Textures\Map

My game learned a lot about Resource Manager, Rocket Stage and Game Stage from:

https://www.youtube.com/watch?v=ANjk6LsShRo&list=PLZd7ojlRK0bwrL8060OGurG_kaeJc_QOH

About

This is my little game that uses the SFML library.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published