SFML community forums

General => SFML projects => Topic started by: arkus on July 24, 2013, 11:06:55 pm

Title: My first space shooter
Post by: arkus on July 24, 2013, 11:06:55 pm
Hey!  :)

I want to show you my first SFML projekt: "Loloid-Attack", a tiny space shooter.  8)
Three levels are finished yet, you gain kredits by killing enemies and you can buy upgrades at the end of the levels.

The whole content is self-made, the sprites are made with GIMP and the sounds with Reason Propellerhead (well the sounds are very annoying so far and only placeholders  :P).

Many functions such as a high score list and some items in the market are still not finished.
I appreciate any criticism, suggestions and bug reports.  ;D

Download: https://www.dropbox.com/s/tbgl26w66t3t5cf/loloid_attack.zip (https://www.dropbox.com/s/tbgl26w66t3t5cf/loloid_attack.zip)
Title: Re: My first space shooter
Post by: Grimshaw on July 24, 2013, 11:26:59 pm
This game is so so amazing :DD I was so entertained playing it that I was quite sad when it suddenly closed :((((

Please finish it so I can play :(
Title: Re: My first space shooter
Post by: eXpl0it3r on July 25, 2013, 12:12:59 am
Haha this is great! :D
Love the graphics and yeah hope the sound effects get a bit adjusted.
Unfortunatly I can't see the screenshots, so here are two other screenshots.

(http://i.imgur.com/jHJqoFF.png)

(http://i.imgur.com/KJK0bco.png)

I was so entertained playing it that I was quite sad when it suddenly closed :((((
So did it close when you died or just after a while?
Well I guess instead of switching to another state it just closes. For the lulz effect when die it's kinda funny though. ^^
Title: Re: My first space shooter
Post by: Grimshaw on July 25, 2013, 12:47:23 am
Closed when the boss died.. that was frustrating :p I was all set to keep improving my ship :D
Title: Re: My first space shooter
Post by: eXpl0it3r on July 25, 2013, 12:54:31 am
Closed when the boss died.. that was frustrating :p I was all set to keep improving my ship :D
Haha true! :D
Title: Re: My first space shooter
Post by: AFS on July 25, 2013, 06:09:30 am
Damn loloids! Damn you! *shakes fist*

Fun game, congrats ;)
Title: Re: My first space shooter
Post by: Vot1_Bear on July 27, 2013, 11:40:30 am
Was wondering why it's called loloid until I saw the screenshot :P

Pretty fun to play even at this stage, especially the boss which has some pretty unique attacks instead of just a normal enemy with bigger health :D

But yeah, too bad it's quite short and closes immediately after the boss died. I was looking forward to maximum rapid-fire ship. Looking forward to further development!

PS: How about making the asteroid speeds randomized as well (and maybe size, too). I'd say it'll be pretty easy to do since you already randomized their position, and a little variation would look great i think. Good luck! :)


Well I guess instead of switching to another state it just closes. For the lulz effect when die it's kinda funny though. ^^
Wait, it just freezes and closes for me when it died...
Title: Re: My first space shooter
Post by: Erikpetrov on July 27, 2013, 03:04:48 pm
Amazing game for first project.I really liked the graphics the boss is so cute :) .
Keep improving the game it can be great.
Title: Re: My first space shooter
Post by: Grimshaw on July 27, 2013, 04:22:25 pm
I'm still waiting to play more levels :( Don't be evil man :D
Title: Re: My first space shooter
Post by: arkus on July 28, 2013, 02:55:14 pm
First of all thank you for all the feedback!  :D
Instead of starting a new level, the game just closes after the boss. i think i will create some new levels with different loloid-enemies before the boss attacks.

Quote
Unfortunatly I can't see the screenshots, so here are two other screenshots.

Thank you for uploading, i still have some trouble with uploading screenshots  :o
Pressing "insert image" with the dropbox hyperlink didn't work for me  :-\

Quote
How about making the asteroid speeds randomized as well (and maybe size, too). I'd say it'll be pretty easy to do since you already randomized their position, and a little variation would look great i think.

I've been thinking about that already, but i don't know how to make it. currently, i create the asteroids with a list and manage the movement and the rotation like this:

if((sf::Randomizer::Random(0,100) < asteroid_spawner) && (asteroid_bool) && (asteroid_list.size() < asteroid_max))
{
                sf::Sprite *asteroid;
                asteroid = new sf::Sprite;
                asteroid->SetImage(asteroid_img);
                asteroid->SetPosition(850+sf::Randomizer::Random(0,60),sf::Randomizer::Random(10,530));
                asteroid_it->Rotate(sf::Randomizer::Random(0,50));

                asteroid_list.push_back(*asteroid);
}

for(asteroid_it = asteroid_list.begin(); asteroid_it != asteroid_list.end(); asteroid_it++)
{
                        asteroid_it->Move(-100*Window.GetFrameTime(),0);
                        asteroid_it->Rotate(1);
                        asteroid_it->SetCenter(25,25);
{
 

Randomized speed and rotation would mean that i would have to create seperate lists for that, wouldn't it?  :o
Additionally, a randomized size would make the colliding between shot/asteroid and player/asteroid much more difficult because i adjusted it to the standard size (+- 25p):

if(schuss_it->GetPosition().y <= asteroid_it->GetPosition().y +25 &&
 schuss_it->GetPosition().y >= asteroid_it->GetPosition().y -25 &&
schuss_it->GetPosition().x >= asteroid_it->GetPosition().x -25)
//{delete asteroid}
 

agenda
- new sounds
- new levels (with new enemies)
- randomized asteroid size and rotation
- new ship upgrades (max armor, shot power, (suggestions?))
- a story (what are the loloids and what do they want?)
Title: Re: My first space shooter
Post by: Vot1_Bear on July 30, 2013, 09:49:22 am
I've been thinking about that already, but i don't know how to make it. currently, i create the asteroids with a list and manage the movement and the rotation like this:

Randomized speed and rotation would mean that i would have to create seperate lists for that, wouldn't it?  :o
Additionally, a randomized size would make the colliding between shot/asteroid and player/asteroid much more difficult because i adjusted it to the standard size (+- 25p):

if(schuss_it->GetPosition().y <= asteroid_it->GetPosition().y +25 &&
 schuss_it->GetPosition().y >= asteroid_it->GetPosition().y -25 &&
schuss_it->GetPosition().x >= asteroid_it->GetPosition().x -25)
//{delete asteroid}
 

agenda
- new sounds
- new levels (with new enemies)
- randomized asteroid size and rotation
- new ship upgrades (max armor, shot power, (suggestions?))
- a story (what are the loloids and what do they want?)

Regarding random speed and sizes: yes, I guess that'll require you to store the numbers on a separate list :P
I'd say just make a struct or something so that each asteroid does not only contain a sf::sprite but also its move_speed (you shouldn't need to store size, you should be able to just increase it once via the setScale function and never bother it again).

On collision detection, you might want to use the contains() function to detect whether a point is inside the asteroid. Say,
//for comparison (current version):
if(schuss_it->GetPosition().y <= asteroid_it->GetPosition().y +25 &&
 schuss_it->GetPosition().y >= asteroid_it->GetPosition().y -25 &&
schuss_it->GetPosition().x >= asteroid_it->GetPosition().x -25)
//{delete asteroid}

//you might wanna try
if (asteroid_it->getLocalBounds().contains(schuss_it)) //delete asteroid
 
Title: Re: My first space shooter
Post by: Yemeni Cpluspluser on July 30, 2013, 07:00:30 pm
;D ;D ;D ;D ;D
Simple yet very inspiring and fun game!, I like the boss :)
too bad 3 levels only.
Title: Re: My first space shooter
Post by: arkus on August 02, 2013, 01:43:16 pm
Houston, we have a problem!

I wrote the entire code into main and already got over 1200 lines...  :o
It becomes more and more difficult to keep an overview and i really have to learn more about classes and all that stuff.
For this reason, i will stop the work on the actual projekt and will try to convert it into a clearer code...
Title: Re: My first space shooter
Post by: Grimshaw on August 02, 2013, 05:25:17 pm
Thats nothing, keep working on it!! :D
Title: Re: My first space shooter
Post by: arkus on August 31, 2013, 05:50:11 pm
Hello!

I just wanted to tell you that I'm still working at the project. I've learned a lot about classes, states and stuff in the last weeks and already built a state-based menu with animated buttoms:  :)

(http://i1244.photobucket.com/albums/gg573/mondscheinprimat/menu_screenshot-1.png) (http://s1244.photobucket.com/user/mondscheinprimat/media/menu_screenshot-1.png.html)

Next I'll work at the game state with the engine and entity managing, but that will take time.

I'm still here!  ;)
Title: Re: My first space shooter
Post by: blojayble on August 31, 2013, 07:58:30 pm
Hi. Your game is simple and fun, but while playing I found a way to cheat a bit.

When you're playing, hold the window bar with a mouse like you would like to move it, and wait like this for a bit. The game will freeze, but music will be still playing. When game is like this, spaceship will be "moving", but no collisions will be detected.

If you want to fix it, put the event loop to other thread, I've got my own fix, if you're interested.

Good luck with improving the game!
Title: Re: My first space shooter
Post by: zsbzsb on August 31, 2013, 08:28:55 pm
When you're playing, hold the window bar with a mouse like you would like to move it, and wait like this for a bit. The game will freeze, but music will be still playing. When game is like this, spaceship will be "moving", but no collisions will be detected.

If you want to fix it, put the event loop to other thread.

Actually that is not a good way to fix the problem. The best way would be to directly fix the problem instead of working around it.

What this problem is commonly known as is called tunneling. When you click and hold the title bar the game loop is temporarily paused, but continues to track elapsed time. After you release mouse the game loop will resume and the time elapsed will be such a large number that the ship has had enough time that it would be past the objects it should have collided with.

The way to fix this has a simple solution. You can implement a fixed time step which will cause your code to do multiple updates when a large amount of time has passed instead one huge update. The huge update is what allows the ship to pass through objects is called tunneling.
Title: Re: My first space shooter
Post by: blojayble on August 31, 2013, 10:01:43 pm
@Up

Yes, you're right. I just mainly thought about fixing the freezing, also as problem with detecting collisions is the other thing.
Title: Re: My first space shooter
Post by: voodinator on September 26, 2013, 06:33:00 pm
Can you make an reup? The Dropbox file is down, would like to test the game :)