Cannon

Showcase your libraries, tools and other projects that help your fellow love users.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Cannon

Post by Nixola »

It's a cannon, nothing more. You open it, you click to decide the angle and you watch this little circle bouncing. Any suggestion?
screen.png
screen.png (5.05 KiB) Viewed 5659 times
Attachments
Cannon.love
0.8.0
(1.46 KiB) Downloaded 247 times
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
iemfi
Citizen
Posts: 52
Joined: Fri Mar 30, 2012 11:03 am

Re: Cannon

Post by iemfi »

Stuff to knock down angry bird style! And upgrades for the cannon/cannon ball! Many levels, multiplayer head to head levels. Would be so awesome.
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Cannon

Post by Nixola »

I thought this game would have become a game in which you simply have to launch the ball as furthest as possible, with obstacles and springs (? I hope it's the right word), but your idea of making it an angry-birds style game is not bad... The former is simpler, the latter is better but I'd need help to make it, since I don't know how to use HardonCollider, love.physics or other physics libraries, and I still can't understand OOP...
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
iemfi
Citizen
Posts: 52
Joined: Fri Mar 30, 2012 11:03 am

Re: Cannon

Post by iemfi »

Think that penguin flying game is hard to beat. An angry-bird style game you only need love.physics and it would do most of the work for you, not that hard to learn :). And what about OOP don't you understand?
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Cannon

Post by Nixola »

Pretty much anything more than

Code: Select all

table.function(table) is equal to table:function()
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
viking
Prole
Posts: 6
Joined: Sun Apr 22, 2012 10:29 am

Re: Cannon

Post by viking »

Just added a quick restart option so you don't have to quit and start the game every time after you've launched the ball.

Code: Select all

function restart()
	love.load()
end

Code: Select all

function love.keypressed(key, unicode)
	if key == "return" and ball.launched then
		restart()
	end
end
Attachments
Cannon_restart.love
(1.49 KiB) Downloaded 173 times
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Cannon

Post by Nixola »

That's what love.load exixts for, I think... Thanks, Viking, I didn't ever think to use love.load like this
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
iemfi
Citizen
Posts: 52
Joined: Fri Mar 30, 2012 11:03 am

Re: Cannon

Post by iemfi »

Here's a quick example of this game using OOP and love.physics. Love.physics does so much of the work for you :). I hope you can understand it, I didn't comment much so pm me if you have any questions.
cannonFirstStep.love
(11.95 KiB) Downloaded 187 times
I went a bit further and implemented an enemy box you have to hit with enough force. The force calculation for the collision still needs to take into account the angle of the impact (a glancing hit should do less damage) but that seems like a pretty difficult calculation.
cannonSecondStep.love
(13.07 KiB) Downloaded 209 times
Use hump.camera to readd the camera system, add some obstacle blocks and you basically have angry birds!
User avatar
Nixola
Inner party member
Posts: 1949
Joined: Tue Dec 06, 2011 7:11 pm
Location: Italy

Re: Cannon

Post by Nixola »

Ok, I rewrote it (I was reading yours during the rewriting though, so it may look very similar to it) and created a basic editor. First you open the editor, then you place some block (be careful, they'll still fall) and save (you can find instructions by holding down F1 or H in the editor); then you run Cannon and load the map.
EDIT: But, without the attachments, you don't really care, I think...
Attachments
Editor.love
Editor! 0.8.0
(2.4 KiB) Downloaded 174 times
hump.class.cannon.love
Cannon! 0.8.0
(6.18 KiB) Downloaded 181 times
lf = love.filesystem
ls = love.sound
la = love.audio
lp = love.physics
lt = love.thread
li = love.image
lg = love.graphics
iemfi
Citizen
Posts: 52
Joined: Fri Mar 30, 2012 11:03 am

Re: Cannon

Post by iemfi »

Nice work with the editor! See, OOP is rather simple no? Would love to see this project completed. I haven't seen an online multiplayer versus mode for this type of game before.
Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests