Kling Klong - aka Fart-Annoyed
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: Kling Klong - aka Fart-Annoyed
Added enemies to the game! They spawn every 10 seconds and can fly through bricks. Only a ball can kill an enemy. Each enemy kill guarantees a power up drop. If an enemy collide with the paddle, you lose a life. Maximum number on enemies is 4.
Carpe noctem
Re: Kling Klong - aka Fart-Annoyed
Sounds awesome man, can't wait to check it out! Nice job coding up and debugging your sprite blitting routine
Chili
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: Kling Klong - aka Fart-Annoyed
Modified and improved a lot of small things, and fixed some bugs.
Most relevant changes:
- laser shots can now kill enemies
- improved power up creation after enemy kills (no useless drops like extraLife and max life etc.)
- level 2 and 3 are swapped (because of their difficulty)
Most relevant changes:
- laser shots can now kill enemies
- improved power up creation after enemy kills (no useless drops like extraLife and max life etc.)
- level 2 and 3 are swapped (because of their difficulty)
Carpe noctem
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: Kling Klong - aka Fart-Annoyed
Added the "super ball" power up, which has its own animation and is really powerful
It destroys everything in its way (even "undestroyable" bricks) and bounces only from the walls. I tried to make it really rare, maybe need some refinement still.
It destroys everything in its way (even "undestroyable" bricks) and bounces only from the walls. I tried to make it really rare, maybe need some refinement still.
Carpe noctem
Re: Kling Klong - aka Fart-Annoyed
Haha, looking awesome man. You got the Surface class integrated properly I see.
The animated enemies look cool.
I took a peek into your source code too, looks solid. Very easy follow, overall good style.
Edit --- v
Need more levels
The animated enemies look cool.
I took a peek into your source code too, looks solid. Very easy follow, overall good style.
Edit --- v
Need more levels
Chili
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: Kling Klong - aka Fart-Annoyed
Thanks Chili! I am pretty satisfied with the game right now. Want to polish it up and refactor the code next. My plans are:
- start screen (with "start game", "exit", etc.)
- different difficulties (ball faster, more enemies, less power ups, etc.)
- more levels
- maybe a scoring system
Regarding more levels: I wanted to make the game engine and all the basic functionalities first. Physics, power ups, enemies and stuff should work solid before starting with adding more content.
The problem at the moment is, that it is pretty difficult to "create" a new level (as you can see in the code). I want to code something like a "level creator", which will create a level out of a 2d array like this:
E E E S S S E E E
B B R R B B R R B
S E S E S E S E S
.... where each character corresponds to a particular brick, E = empty, S = solid, etc. This would make new level creation much easier.
- start screen (with "start game", "exit", etc.)
- different difficulties (ball faster, more enemies, less power ups, etc.)
- more levels
- maybe a scoring system
Regarding more levels: I wanted to make the game engine and all the basic functionalities first. Physics, power ups, enemies and stuff should work solid before starting with adding more content.
The problem at the moment is, that it is pretty difficult to "create" a new level (as you can see in the code). I want to code something like a "level creator", which will create a level out of a 2d array like this:
E E E S S S E E E
B B R R B B R R B
S E S E S E S E S
.... where each character corresponds to a particular brick, E = empty, S = solid, etc. This would make new level creation much easier.
Carpe noctem
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: Kling Klong - aka Fart-Annoyed
Added a really fancy start screen and a simple main menu. Want to tackle the level creator, but cannot work with this fu.... arrays anymore. Will switch to std::vector which will cost some time I guess. The current commit will be the last without vectors.
Carpe noctem
Re: Kling Klong - aka Fart-Annoyed
This is what i do for levels. I have a text file layed out how you have mentioned the read it in like so
then read the data like so
Just to give you an idea
Code: Select all
// function from my utils class
static __inline std::vector<std::string> LoadTextFile(std::string filename)
{
std::fstream txtfile(filename.c_str());
assert(txtfile.good());
std::vector<std::string> text;
if (txtfile.good())
{
std::string str;
while (std::getline(txtfile, str))
{
text.push_back(str);
}
txtfile.close();
}
return std::move(text);
}
Code: Select all
std::vector<std::string> map = Utils::LoadTextFile(filename);
Vec2 pos = {0.0f,0.0f};// whereever you wish to start
float x = pos.x;
for (size_t r = 0; r < rows; r++)
{
x = pos.x; /// reset x on every new row
for (size_t c = 0; c < columns; c++)
{
switch (map[r][c])
{
case 'E': // letter in textfile
{
// add block that is
}
break;
case 'B':
{
// add block
}
break;
default:
break;
};
x += tilewidth;// move position per column
}
pos.y += tileheight;// move to next row
}
Curiosity killed the cat, satisfaction brought him back
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: Kling Klong - aka Fart-Annoyed
Thx MrGodin! My refactoring comes slowly to the end Will test your stuff afterwards.
Carpe noctem
- SlevinKelevra
- Posts: 80
- Joined: September 9th, 2013, 12:58 am
- Location: Germany
Re: Kling Klong - aka Fart-Annoyed
Refactoring finally done! Now Game.cpp/.h are small again
Most of the stuff is done by the klingklong manager class.
- added loading level desings from text file (thanks again to MrGodin for the tip!)
- added some more levels
- added small victory sprite/text
What I plan to do next:
- some nerf to the super ball power up (still too strong)
- adding more cool levels
- improving main menu (continue, restart, etc.)
- adding difficulty levels
Most of the stuff is done by the klingklong manager class.
- added loading level desings from text file (thanks again to MrGodin for the tip!)
- added some more levels
- added small victory sprite/text
What I plan to do next:
- some nerf to the super ball power up (still too strong)
- adding more cool levels
- improving main menu (continue, restart, etc.)
- adding difficulty levels
Carpe noctem