I made this little game and I thought I'd share it here. WASD to control the player, left click to shoot, right click to reload. Select Handgun or Machinegun with keys 1 and 2. You must be standing still to change weapons. Kill and survive as long as you can.
Feel free to read the code and / or comment anything you want
You can fork this project at: https://github.com/Ellohir-noldo/Love-for-zombies
Love for zombies
Love for zombies
- Attachments
-
- love_for_zombies_v2.42.love
- (1.67 MiB) Downloaded 552 times
Last edited by Ellohir on Sat Oct 27, 2012 4:42 pm, edited 17 times in total.
Re: Love for zombies
Quite a nice little game.
After a few restarts the sounds crashed and the game started acting weirdly. You might get that under control by using the the BDSM(http://love2d.org/forums/viewtopic.php?f=5&t=3804) or some other kind of sound manager.
After a few restarts the sounds crashed and the game started acting weirdly. You might get that under control by using the the BDSM(http://love2d.org/forums/viewtopic.php?f=5&t=3804) or some other kind of sound manager.
Re: Love for zombies
Ouch, yes, I forgot to stop the sound on restart so background sound is stacking with itself. I've fixed it. Thank you very much
Last edited by Ellohir on Sat Nov 05, 2011 12:39 pm, edited 1 time in total.
Re: Love for zombies
I love zombie games
It's a nice one. May some little tweaks:
+ Add a delay at weapon reloading so the player have to wait may 0,5 - 1,5 sec
+ Sometimes zombies appear very near behind the player (backward movement), so thats a bit "unfair".
+ Let zombies move in different speed, this add some more action instead of stress but at something like the same difficulty.
But I enjoy playing it, and thats the most important thing.
Keep up your work !
edit: oh and I dont know why, but your .love is very big o.o May need some compression of the sound files
edit 2: and clever players just hold the right mouse button. Maybe you change this so it is not possible
Greets
It's a nice one. May some little tweaks:
+ Add a delay at weapon reloading so the player have to wait may 0,5 - 1,5 sec
+ Sometimes zombies appear very near behind the player (backward movement), so thats a bit "unfair".
+ Let zombies move in different speed, this add some more action instead of stress but at something like the same difficulty.
But I enjoy playing it, and thats the most important thing.
Keep up your work !
edit: oh and I dont know why, but your .love is very big o.o May need some compression of the sound files
edit 2: and clever players just hold the right mouse button. Maybe you change this so it is not possible
Greets
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Love for zombies
This is super cool.
A few suggestions:
A few suggestions:
- I see you have a maps folder. More maps? I take it this is a given though.
- Instead of showing the number of bullets left, maybe show the actual number, and then "RELOAD" when you're empty.
- When you start the game, you automatically shoot a bullet.
- When it says game over, the "you" 's are not capitalized. Since the rest of the game is capitalized, maybe capitalize them too?
- Looking at your code, zombies come at a consistent rate of 1zombie/0.8seconds. Perhaps make more come over time, or get them to come in bigger and bigger waves?
- The grass is very repetitive. Consider having multiple grass types and stitching them together?
- I can see the player, the cursor and the bullet amount in the main screen. Maybe make them entirely different scenes?
- I agree with Larsii30 on the sound size. Doing a du -h * on /sound, I get:
1.5M bgm.wav
1.2M death.wav
12K empty.wav
172K kill.wav
44K reload.wav
24K shot.wav
4.9M storm.mp3
bgm.wav and death.wav are far too raw, and could easily be reduced.
As for storm.mp3, it is 254 seconds of "storm" when you could easily just use the first 30 seconds, loop it, and still get a nice thunder sound in there. It could also be easily reduced.
- I like how you pause everything when the game is not in focus. Very nice.
- The main screen and the game over screen are awesome.
- Persistent high score
- Very clean and well organized code
- Pretty damn perfect font choice
- The controls are very simple and natural. Movement is also rather natural.
- Different zombies with differen amounts of health and speed?
- Multiple guns?
- Multi-player?
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Re: Love for zombies
Thanks for the feedback!
Added the reloading delay and zombie different speed. I've tried it and it makes it much more fun! Thanks for the suggestion.
I like viewing the scene behing the menu. That's why it's semitransparent, so that when I hit "Start" I know what the scene is and what does the player look like. I also like the cursor to be the same on the menu and the game. I removed the bullet indicator, that wasn't a nice detail.
Thanks again for your feedback
I already have a "not-spawning" area around the player, seems like it was too little. I made it bigger, shouldn't happen now.Larsii30 wrote: + Add a delay at weapon reloading so the player have to wait may 0,5 - 1,5 sec
+ Sometimes zombies appear very near behind the player (backward movement), so thats a bit "unfair".
+ Let zombies move in different speed, this add some more action instead of stress but at something like the same difficulty.
Added the reloading delay and zombie different speed. I've tried it and it makes it much more fun! Thanks for the suggestion.
Yes, this was in mind when coding. It should be easy to get a bigger spritesheet and to make more maps. The thing is, without a collision system maps are now just background image. Maybe I'll add some support for tile-collision and maze maps, but that would mean programming some zombie IA too so I don't think about it right now.josefnpat wrote: [*] I see you have a maps folder. More maps? I take it this is a given though.
[*] The grass is very repetitive. Consider having multiple grass types and stitching them together?
I didn't understand what you ment with "the actual number" but I made the count of bullets blink when empty xD Fixed the select+shoot problem and the capitalization.josefnpat wrote: [*] Instead of showing the number of bullets left, maybe show the actual number, and then "RELOAD" when you're empty.
[*] When you start the game, you automatically shoot a bullet.
[*] When it says game over, the "you" 's are not capitalized. Since the rest of the game is capitalized, maybe capitalize them too?
I thought about it but when I was playing I already found it hard to survive with a constant spawn rate xD I'll think about it but I don't see it necessary right now.josefnpat wrote: [*] Looking at your code, zombies come at a consistent rate of 1zombie/0.8seconds. Perhaps make more come over time, or get them to come in bigger and bigger waves?
[*] I can see the player, the cursor and the bullet amount in the main screen. Maybe make them entirely different scenes?
I like viewing the scene behing the menu. That's why it's semitransparent, so that when I hit "Start" I know what the scene is and what does the player look like. I also like the cursor to be the same on the menu and the game. I removed the bullet indicator, that wasn't a nice detail.
Yeah, this is a must. I've been using some default free sounds because I don't have a sound editor installed, but it's top on the priority list.josefnpat wrote: [*] I agree with Larsii30 on the sound size. Doing a du -h * on /sound, I get:
1.5M bgm.wav
1.2M death.wav
12K empty.wav
172K kill.wav
44K reload.wav
24K shot.wav
4.9M storm.mp3
bgm.wav and death.wav are far too raw, and could easily be reduced.
As for storm.mp3, it is 254 seconds of "storm" when you could easily just use the first 30 seconds, loop it, and still get a nice thunder sound in there. It could also be easily reduced.
I definately have to add a shotgun. Every zombie game needs a shotgun xD I don't know about the rest.josefnpat wrote: Enhancements:
[*] Different zombies with differen amounts of health and speed?
[*] Multiple guns?
[*] Multi-player?
Thanks again for your feedback
Last edited by Ellohir on Sat Nov 05, 2011 12:39 pm, edited 1 time in total.
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Love for zombies
0 bullets: RELOAD
1 bullet:
2 bullets:
3 bullets:
...
8 bullets:
1 bullet:
2 bullets:
3 bullets:
...
8 bullets:
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Re: Love for zombies
Set up some tiles und give them ID's. i.e dirt,grass,sand = 0 (player could walk on them without any problems) - water,sump,mud = 1 (player could walk on with slower movement speed) and wall,box, and whatever = 3 ( player can't walk on ). So may you dont need a collsion, just a function that returns the tile the player is on (or is about to going on).Ellohir wrote: The thing is, without a collision system maps are now just background image.
here are the compressed audio files, still a bit big but much better. I compressed them using audacity with .ogg codec, love2d is able to play them. May better then other compressions. you have to change the names in you code to .ogg.
Edit: aaand i've shorted the storm.ogg ! Way to large just for a storm You should loop it.
greets!
Re: Love for zombies
Much more visual. I love it. I should have thought of that before xD Modified.josefnpat wrote:0 bullets: RELOAD
1 bullet:
2 bullets:
3 bullets:
...
8 bullets:
Good idea, I'll see what I can do.Larsii30 wrote:Set up some tiles und give them ID's. i.e dirt,grass,sand = 0 (player could walk on them without any problems) - water,sump,mud = 1 (player could walk on with slower movement speed) and wall,box, and whatever = 3 ( player can't walk on ). So may you dont need a collsion, just a function that returns the tile the player is on (or is about to going on).
Thanks for the modified audio, I've replaced it
So here is version 1.03, five times lighter than the others and... yes, probably the last of today xD
Thanks for the help Larsii30 and Josefnpat, I really appreciate it
- josefnpat
- Inner party member
- Posts: 955
- Joined: Wed Oct 05, 2011 1:36 am
- Location: your basement
- Contact:
Re: Love for zombies
Noticed another bug. Highscores don't allow for caps and sillykeys like capslock go bananas.
This is what I do in yalt.
Keep in mind this is hack-and-slash from my own code, so it might not work "out of the box"
This is what I do in yalt.
Keep in mind this is hack-and-slash from my own code, so it might not work "out of the box"
Code: Select all
key_disable = { --keys to disable in case they are not in use.
"up","down","left","right","home","end","pageup","pagedown",--Navigation keys
"insert","tab","clear","delete",--Editing keys
"f1","f2","f3","f4","f5","f6","f7","f8","f9","f10","f11","f12","f13","f14","f15",--Function keys
"numlock","scrollock","ralt","lalt","rmeta","lmeta","lsuper","rsuper","mode","compose",--Modifier keys
"pause","escape","help","print","sysreq","break","menu","power","euro","undo"--Miscellaneous keys
}
key_capslock = false
key_shift = false
key_ctrl = false
function love.keypressed(key,unicode)
if key == "backspace" then -- remove last character
--do your stuff
elseif key == "rshift" or key == "lshift" then -- enable shift
key_shift = true
elseif key == "capslock" then -- enable capslock
key_capslock = true
elseif key == "lctrl" or key == "rctrl" then -- enable ctrl
-- This does not account for someone who pushes both ctrl keys.
-- Who does that anyway?
key_ctrl = true
elseif in_table(key_disable,key) then -- do nothing, this key is disabled.
else
--do your stuff
end
end
function in_table(t,s)
for i,v in pairs(t) do
if (v==s) then
return true
end
end
end
Missing Sentinel Software | Twitter
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
FORCIBLY IGNORED.
<leafo> when in doubt delete all of your code
<bartbes> git rm -r *
<bartbes> git commit -m "Fixed all bugs"
<bartbes> git push
Who is online
Users browsing this forum: Amazon [Bot] and 6 guests