Page 1 of 2
Need feedback on my first experiment...
Posted: Sat May 18, 2013 9:20 pm
by Cucurbitacée
Hi everyone,
After a chaotic start, I think I begin to get how Löve works. And I begin to become really addict.
After a few days (yes, I will never be an efficient coder, or even a real coder at all) I managed to make a small shoot'em up.
It started as an experiment to generate a random star field an went on a mini game. It has an (ugly) menu screen, a gameplay phase and a (ridiculous) game over screen.
If someone is curious enough, I'd love to get a feedback on the code. At the moment there are some nasty slowdowns
, even if it is an extremely simple game.
Thanks in advance.
BTW, I'm still working on the artwork and the enemy is stollen from Nemesis, I hope it's not a problem. I'll replace it with one of my own soon.
Re: Need feedback on my first experiment...
Posted: Sat May 18, 2013 11:24 pm
by Kingdaro
Welcome to LÖVE!
I played this, and it's actually really good for a first! A couple of comments I personally have with the actual game:
- The ship movement is a little sluggish, and isn't very arcade-like (I suppose that would be the right word for it...)
- I would prefer to use keys like Z or X to shoot, as they aren't as clunky as using the spacebar. This is purely my preference, and I do recognize the spacebar as a common standard.
- A lives system would be nice, as it's rather easy to die. (Or maybe I just suck )
Looking through the code, the way you coded this is actually very readable, consistent, and easy to understand. Though, on the game over screen, the script calls love.load(), which shouldn't be done explicitly. Instead, you should probably put game loading into a separate function and use that if you want to reset/reload the game.
Also a tip, you can greatly increase the size of your window, while keeping the same image sizes and pixelation, making the game much easier to see and play. The use of this is mainly centered around the use of love.graphics.scale(). It's tricky though, because the graphics drawing scale and the window size are completely independent of one another. Here's what I did:
main.lua (under love.load):
Code: Select all
scale = 2
screen_width = love.graphics.getWidth()
screen_height = love.graphics.getHeight()
love.graphics.setDefaultImageFilter('linear', 'nearest')
love.graphics.setMode(screen_width * scale, screen_height * scale)
I set the scale variable to 2, meaning everything should be twice as big. Then I set two screen height and width reference variables to use instead of love.graphics.getWidth()/love.graphics.getHeight(). These contain the "actual size" of the screen to be used by love.graphics.
The fourth line is a function that makes all of the images non-blurry when scaling up by changing the way image scaling works.
More info on the wiki.
The fifth line scales the window's size according to our scale variable, so we can see everything onscreen.
Here's a .love of my changes.
Re: Need feedback on my first experiment...
Posted: Sun May 19, 2013 5:12 am
by T-Bone
Since you never have anything to lose by constantly shooting, it would've been better if you could just hold down the fire button, allowing you to concentrate on navigating.
Re: Need feedback on my first experiment...
Posted: Mon May 20, 2013 1:13 pm
by Cucurbitacée
Kingdaro wrote:Welcome to LÖVE!
I played this, and it's actually really good for a first!
Thanks!
Kingdaro wrote:A couple of comments I personally have with the actual game:
- The ship movement is a little sluggish, and isn't very arcade-like (I suppose that would be the right word for it...)
- I would prefer to use keys like Z or X to shoot, as they aren't as clunky as using the spacebar. This is purely my preference, and I do recognize the spacebar as a common standard.
- A lives system would be nice, as it's rather easy to die. (Or maybe I just suck )
- My inspiration is really R-Type, so at the moment the ship is slow because I intend to add a speed-up system.
- I've added an options menu to allow different key mapping, that should do the trick.
- The lives system is almost there, at the moment the player only has 1 life...
All of this to say that at the moment the "game" is nothing more than a sandbox for me to learn Löve, but I'm glad you're considering it as a proper game.
Kingdaro wrote:Looking through the code, the way you coded this is actually very readable, consistent, and easy to understand. Though, on the game over screen, the script calls love.load(), which shouldn't be done explicitly. Instead, you should probably put game loading into a separate function and use that if you want to reset/reload the game.
Thanks, that's good to know. I think I've seen a tutorial doing so... then I did the same. By the way my code is a mix of a lot of tutorial and posts I've been looking; that's why it may be inconstant.
Kingdaro wrote:Also a tip, you can greatly increase the size of your window, while keeping the same image sizes and pixelation, making the game much easier to see and play. The use of this is mainly centered around the use of love.graphics.scale(). It's tricky though, because the graphics drawing scale and the window size are completely independent of one another. Here's what I did:
main.lua (under love.load):
Code: Select all
scale = 2
screen_width = love.graphics.getWidth()
screen_height = love.graphics.getHeight()
love.graphics.setDefaultImageFilter('linear', 'nearest')
love.graphics.setMode(screen_width * scale, screen_height * scale)
I set the scale variable to 2, meaning everything should be twice as big. Then I set two screen height and width reference variables to use instead of love.graphics.getWidth()/love.graphics.getHeight(). These contain the "actual size" of the screen to be used by love.graphics.
The fourth line is a function that makes all of the images non-blurry when scaling up by changing the way image scaling works.
More info on the wiki.
The fifth line scales the window's size according to our scale variable, so we can see everything onscreen.
Here's a .love of my changes.
That's a great idea, I didn't thought of that. And I've added your code to my options menu. But it seems I can't change the filter settings on the fly...
T-Bone wrote:Since you never have anything to lose by constantly shooting, it would've been better if you could just hold down the fire button, allowing you to concentrate on navigating.
This is another part of the sandbox, I want to add a function to focus beam when the shoot key his being hold (R-Type style, once again). I see it as an opportunity to play with the particles for a nice visual effect.
Anyway, I went on and add some stuff:
- A new menu with an options menu and the possibility to quit.
- A fading option when the game starts, still needs to be polished, though.
- Sounds effect! For menu navigation, player shot, enemies explosions and player explosion.
- Music (stolen from Jamendo, if I try to do it myself it would take ages for shitty result! That's why the .love is so big now.
And now the thing I want to do:
- Make real levels, at the moment the enemies are randomly spawn on screen. That means a lot of artwork.
- Implement chain scoring system.
- Save settings and scores to a file.
Thanks for your feedback.
Re: Need feedback on my first experiment...
Posted: Wed May 29, 2013 9:08 pm
by YGOFreak1997
I'm sorry for such a short reply, but I actually found a small bug
If you just stay at the lower left corner, you aren't being hit by the enemies' bullets and can survive like forever xD
greetings, Bastian.
Re: Need feedback on my first experiment...
Posted: Thu May 30, 2013 1:18 pm
by vitaminx
Hey, there's an issue with the enemies:
They suddenly disappear when they touch the left side of the window.
I didn't look at your code but seems you remove them when their x position is less than zero, right?
You should instead remove them when they are less than -enemy_width
Re: Need feedback on my first experiment...
Posted: Thu May 30, 2013 3:01 pm
by jjmafiae
Cucurbitacée wrote:Hi everyone,
After a chaotic start, I think I begin to get how Löve works. And I begin to become really addict.
After a few days (yes, I will never be an efficient coder, or even a real coder at all) I managed to make a small shoot'em up.
It started as an experiment to generate a random star field an went on a mini game. It has an (ugly) menu screen, a gameplay phase and a (ridiculous) game over screen.
If someone is curious enough, I'd love to get a feedback on the code. At the moment there are some nasty slowdowns
, even if it is an extremely simple game.
Thanks in advance.
BTW, I'm still working on the artwork and the enemy is stollen from Nemesis, I hope it's not a problem. I'll replace it with one of my own soon.
do i suck or is this game really hard?
Re: Need feedback on my first experiment...
Posted: Thu May 30, 2013 7:11 pm
by YGOFreak1997
It is kinda hard because there are so many enemies x3 But you could maybe get an autofire for the space bar or someting
Re: Need feedback on my first experiment...
Posted: Fri May 31, 2013 9:08 am
by Jimanzium
It ran waaaaaaay to slow for me to even play
But it looked nice
Re: Need feedback on my first experiment...
Posted: Mon Jun 10, 2013 8:55 pm
by Cucurbitacée
YGOFreak1997 wrote:I'm sorry for such a short reply, but I actually found a small bug
If you just stay at the lower left corner, you aren't being hit by the enemies' bullets and can survive like forever xD
greetings, Bastian.
I guess I would need to lower the lowest random y position, thanks for the tip.
vitaminx wrote:Hey, there's an issue with the enemies:
They suddenly disappear when they touch the left side of the window.
I didn't look at your code but seems you remove them when their x position is less than zero, right?
You should instead remove them when they are less than -enemy_width
You're right, they are removed when their x coordinate is less than 0, thanks for the tip to add the enemy width, I will add it.
jjmafiae wrote:do i suck or is this game really hard?
It's not easy, for sure. But the randomness effect has to be taken in account too. Sometimes a game will be easier than another one...
YGOFreak1997 wrote:It is kinda hard because there are so many enemies x3 But you could maybe get an autofire for the space bar or someting
I'm working on it, at the moment.
Jimanzium wrote:It ran waaaaaaay to slow for me to even play
But it looked nice
That's what really troubles me. On my home computer (Core2Duo 2.33 ghz, 3 Gb RAM, GeForce 6600, Snow Leopard) the game is really smooth but on my work computer (Bi-Xeon 3 ghz, 8 Gb RAM, GeForce Quadro, Windows 7) it's really choppy, the game freeze for quarter of a second every time an enemy explodes.
I'm having a hard time figuring why the performance is so much worse on a way more powerful computer. Unless it's an OS issue...