SFML community forums

General => SFML projects => Topic started by: The Terminator on November 06, 2012, 03:02:46 am

Title: Survive and Thrive
Post by: The Terminator on November 06, 2012, 03:02:46 am
Intro:
Hello all, I'm here to introduce one of my big projects called Survive and Thrive. Survive and Thrive is a 2D zombie game that is based on waves. Every wave zombies are spawned in increments depending on the wave. The objective of the game is to survive and thrive  :P. You must kill zombies in order to gain cash to further advance your character.

When are updates coming?
Updates will be shoveled out depending on how much time I have. Expect to see more updates during the weekend than the week. (high school for you)

Shout outs:
A huge shout out to eXpl0it3r as I use some of his code for the state engine.

Conclusion:
Anyways, thanks for looking at my up and coming project! I welcome CONSTRUCTIVE criticism and bug reports. A heads up for the people who download this version, it's only v0.1 so most of the main menu doesn't work. (yet) If you are interested in becoming a part in this project, message me as I need an artist for sprites and images. Thanks once again for reading!

Download Link:
http://www.mediafire.com/?z8wzlptuj1js5kz
Title: Re: Survive and Thrive
Post by: kaB00M on November 06, 2012, 06:16:09 am
It's not working for me.  :-\

I get to the main menu, but when I try to access either "Play", or "Help", only a black screen appears.

 :(
Title: Re: Survive and Thrive
Post by: Tank on November 06, 2012, 08:36:35 am
Same here, launching via Wine in Debian GNU/Linux Sid.
Title: Re: Survive and Thrive
Post by: The Terminator on November 06, 2012, 12:30:51 pm
I had mentioned that those didn't work. I'm finishing up the main menu in
The next probably 2 days once I scrounge some time. Thanks for taking an interest however.
Title: Re: Survive and Thrive v0.4
Post by: The Terminator on November 08, 2012, 03:41:50 am
New update!

New Features:
Finished Main Menu
A few bug fixes
Added character and ability to move
Found new artist :P
New textures
Press escape during play mode to go back to main menu

To come:
Total graphical overhaul
Collision in the map
Background music
Character states (direction, etc)

Hope you guys like the update :D. More to come soon once my artist finishes the textures and backgrounds.

Download link: http://www.mediafire.com/?ifyhwplu89yn1ai
Title: Re: Survive and Thrive
Post by: The Terminator on December 02, 2012, 03:41:04 am
MAJOR UPDATE: V0.7!!!

New Features:
More graphics
Player orientation
Shooting
Guns
Code Cleanup

Bugs Fixed:
Collision
Crashes
Invalid texture filepaths

Upcoming features:
Reloading
Graphics for guns
Sound/Music
Recoil

IMPORTANT!
Shooting theoretically works (within the code), but I do not have the textures for it so you can't see it graphically.
I'm going to add recoil in the next update so you can't just hold down spacebar and shoot really fast :P.

Download Link:
http://www.mediafire.com/?zk7mmqq39c6vf0c

HAVE FUN, REPORT BUGS, AND THANK YOU!!!
Title: Re: Survive and Thrive
Post by: Nexus on December 02, 2012, 11:32:13 am
Sometimes when starting the game or leaving via [X] in the window, the game stops responding.

Also, you should not move the character a step once a sf::Event arrives, this leads to a delay until he can move fluently. Take sf::Keyboard, or memorize whether a key is pressed or released.
Title: Re: Survive and Thrive
Post by: The Terminator on December 02, 2012, 02:22:22 pm
Sometimes when starting the game or leaving via [X] in the window, the game stops responding.

Also, you should not move the character a step once a sf::Event arrives, this leads to a delay until he can move fluently. Take sf::Keyboard, or memorize whether a key is pressed or released.

Thanks for your feedback nexus! I actually already fixed the problems with the game not responding. I had a memory leak within my gun class, but I fixed it immediately after I released v0.7 actually. I'm a bit confused on what you mean by "take sf::Keyboard". Could you delve further into what you mean?
Title: Re: Survive and Thrive
Post by: Nexus on December 02, 2012, 02:32:50 pm
Memory leaks? Ah, nostalgia :D
If you don't manage memory manually with new and delete, but work with RAII instead, this problem is history. Avoid owning pointers (http://dl.dropbox.com/u/6101039/Modern%20C%2B%2B.pdf) wherever possible. If you really need them, take std::unique_ptr.

Events are useful to know about state changes. For example, a key that has been pressed or released (once in the last frame). For movement, you want to know the current state, namely whether the key is pressed or released (at the moment). That's what sf::Keyboard provides.
Title: Re: Survive and Thrive
Post by: The Terminator on December 02, 2012, 07:05:10 pm
UPDATE: V0.7.2!!!

New Features:
Recoil
Bullet collision
Reloading

Bugs Fixed:
Fixed all known memory leaks

Explanation of features:
Recoil - The recoil is not "graphical". What recoil pretty much means is that you can't shoot like 100 bullets per second :P. Different guns have certain times in between shots that you must wait before you can shoot again.

Bullet Collision
Does exactly as it says, it allows for the collision of bullets against other sprites. This will be used later for shooting zombies (obviously). For debugging purposes, I have just made the bullet collide with the barrier sprites.

Reloading
For realism, if you have bullets left in your clip when you reload, you lose them. You will start with a fresh new clip once you reload. This feature promotes not reloading a bunch of times pretty much :P

Upcoming features:
Zombies! :O
More guns
Waves
GUI for buying weapons, supplies, etc

Thanks for reading! :D

Download link:
http://www.mediafire.com/?39yeq7syjs28ixd
Title: Re: Survive and Thrive
Post by: greeniekin on December 03, 2012, 04:50:06 am
The Terminator I would love to see some pictures or better yet a video of what you got.

Nexus great article about pointers.
the one that does this
huge_object build_new_object() {
  huge_object ret;
  …
  return ret;
}
 

Seems odd as that would make a copy of that huge object. Which could be bad if it was a map.
wouldn't you use an auto_ptr//deprecated
or a shared pointer if you wanted to ever avoid having to delete pointers and the associated annoyance of memory leaks.

I genuinely do not know. I'm sure that guy is much better experienced than I am.
Title: Re: Survive and Thrive
Post by: mateandmetal on December 03, 2012, 07:09:21 am
Seems odd as that would make a copy of that huge object..

I think he is using C++11 move semantics, so the huge object is moved
Correct me if Im wrong
Title: Re: Survive and Thrive
Post by: cire on December 03, 2012, 08:08:11 am
http://en.wikipedia.org/wiki/Copy_elision
Title: Re: Survive and Thrive
Post by: Nexus on December 03, 2012, 09:37:10 am
http://en.wikipedia.org/wiki/Copy_elision
Copy elision and (N)RVO are optimizations, i.e. it depends on the compiler's goodwill to perform them. That's why such code evokes a strange feeling at many C++ programmers.

As mateandmetal stated, C++11 introduces move semantics to transfer the ownership of objects and, by doing so, avoids many unnecessary copies. Objects can be made movable (implicitly or with the definition of move constructor and move assignment operator), such that compilers must not copy them if the context doesn't require a copy.

By the way, the deprecated std::auto_ptr has been replaced with std::unique_ptr.
Title: Re: Survive and Thrive
Post by: The Terminator on December 03, 2012, 01:02:53 pm
I'll try to make a demo of the game once I get out of school in a couple hours. It'll depend if my teachers are merciful upon me :P