## pew pew BOOM!

Show off your games, demos and other (playable) creations.
kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Contact:

### pew pew BOOM!

Hi there!

This is where I'll be presenting my newest project, "pew pew BOOM!".

My intention is to make a complete game. This is how the first demo looks:
Screenshot of v0.3
pew-pew-boom.jpg (31.07 KiB) Viewed 2045 times
It's Asteroids-inspired, but the complete game should resemble Escape-Velocity more. You can shoot, but asteroids will not explode, so there's some "pew-pew" but not a lot of "BOOM" for now.

Controls:
• The ship will always try to look at the mouse.
• Move it around with w,a,d.
• Left click fires.
• Tab toggles 'debug mode' EDIT: This now includes quadtree visualization
There are two ship models (Lens Culinaris and Razor). The former is slower (in linear and angular velocity) but has one more slot (4 instead of 3) than the later. So it is more customizable.

Customization happens through modules: There are 3 types of cannon, thrusters and gyroscopes to be put on those slots. Bigger cannons shoot bigger, better, faster projectiles. Thrusters make ships move faster while gyroscopes make them turn faster.

In the future, I plan to add shield and energy generators, afterburners, missile-launchers, tractor beams, and other cool stuff.

If you feel like it, you can experiment with the ship models and modules, in the Game.lua file.

There's also 7 kinds of multicoloured asteroids to ... push around. Enjoy!
pew-pew-boom-0.3.love
version 0.3 - including a QuadTree
Also, 3 things:
• I can't center the text of the buttons properly. It shows "too down" on the buttons. But the rectangle I use for invoking love.graphics.print *is* centered. The code that calculates the positioning is on passion/gui/Label.lua. I've no idea of what is wrong there, or whether there's a problem with the font used.
• On my Ubuntu, sound stopped working after a while. It could be a local problem on my machine; I would be interested to know if anyone else is experiencing issues with sound.
• This code is inefficient. I would be interested to know if the game went too slowly on your computers (please include basic specs)
Last edited by kikito on Sun Apr 18, 2010 11:18 pm, edited 2 times in total.
When I write def I mean function.

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: pew pew BOOM!

kikito wrote:
• I can't center the text of the buttons properly. It shows "too down" on the buttons. But the rectangle I use for invoking love.graphics.print *is* centered. The code that calculates the positioning is on passion/gui/Label.lua. I've no idea of what is wrong there, or whether there's a problem with the font used.
Text origin is left-baseline, which is the bottom of this “x” here.
kikito wrote:
• On my Ubuntu, sound stopped working after a while. It could be a local problem on my machine; I would be interested to know if anyone else is experiencing issues with sound.
Here on Xubuntu, LÖVE + sound is jazzy all the time (if it works at all, that is).

matthewburk
Prole
Posts: 15
Joined: Fri Mar 05, 2010 6:56 am

### Re: pew pew BOOM!

I like it because you can't lose!! My 23 month old daughter will be playing this, I'll let you know what she thinks.

matthewburk
Prole
Posts: 15
Joined: Fri Mar 05, 2010 6:56 am

### Re: pew pew BOOM!

kikito wrote:I can't center the text of the buttons properly. It shows "too down" on the buttons. But the rectangle I use for invoking love.graphics.print *is* centered. The code that calculates the positioning is on passion/gui/Label.lua. I've no idea of what is wrong there, or whether there's a problem with the font used.

It's not you its love. There is currently no way print text with an origin other than left-baseline, left-bottom is what you are probably expecting it to do. Of course since there are no font metrics available you have to experiment with adjusting the draw position and you have to do it for every font you use ((. And its not actually left either, depending on the font you use the rendered text can extend to the left beyond the x position specified. There is no way to adjust for that at all except for just not using some fonts.

bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: pew pew BOOM!

Amazingly enough there was a fix, but it was decided to keep 0.6.2 backwards-compatible, font-wise.

kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Contact:

### Re: pew pew BOOM!

aww.

Maybe on next version ?
When I write def I mean function.

kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Contact:

### Re: pew pew BOOM!

It seems that setGroupIndex / getGroupIndex will be working correctly on the next LÖVE version.

In the meantime, here's a lua-only fix. I believe that requiring this file will add the getGroupIndex / setGroupIndex methods to Shapes automatically.

Code: Select all

-- fixGroupIndex.lua
-- fixes shape:getGroupIndex and shape:setGroupIndex on LÖVE <= 0.6.2
-- usage: require 'fixGroupIndex.lua'

local getGroupIndex= function(shape)
local _, _, groupIndex = shape:getFilterData()
return groupIndex
end

local setGroupIndex= function(shape, groupIndex)
local categoryBits, maskBits, _ = shape:getFilterData()
end

local world = love.physics.newWorld(100,100)

local body = love.physics.newBody(world)

-- Fix the CircleShape metatable
local c_mt = getmetatable(love.physics.newCircleShape(body, 10,10, 5))
c_mt.setGroupIndex = c_mt.setGroupIndex or setGroupIndex
c_mt.getGroupIndex = c_mt.getGroupIndex or getGroupIndex

-- Fix the PolygonShape metatable
local p_mt = getmetatable(love.physics.newPolygonShape(body, 20,20, 30,20, 20,30))
p_mt.setGroupIndex = p_mt.setGroupIndex or setGroupIndex
p_mt.getGroupIndex = p_mt.getGroupIndex or getGroupIndex

body:destroy()
world = nil

Internally, it adds two functions that use set/getFilterData to implement the effect. I had to create a small world and a body just to be able to get the Shapes metatables. I'm wondering if there's a more straightforward way of doing that.

Any questions / comments on this code will be welcome!
When I write def I mean function.

Robin
The Omniscient
Posts: 6506
Joined: Fri Feb 20, 2009 4:29 pm
Location: The Netherlands
Contact:

### Re: pew pew BOOM!

Have you tested it?

Because metatable != its __index field (not necessarily, anyway). Plus, I'm not even sure if they have a metatable for Shapes.

bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

### Re: pew pew BOOM!

I never make the metatable the __index field for example, love does, however. And of course we have one, we have to, else we can't have the __gc field, and garbage collection is pretty useful if you don't want memory leaks...

kikito
Inner party member
Posts: 3153
Joined: Sat Oct 03, 2009 5:22 pm
Contact:

### Re: pew pew BOOM!

Hi Robin,

I did test it. The Shapes metatables seem to be set up so mt.__index = mt. I know this because when I tried dumping them over the console with a for loop they iterated over and over again on the screen. Fortunately my dumping function has a "depth level" so it wasn't really an infinite loop.

... The thing is that it doesn't seem to be working the way I want. For some reason the ship "moves a bit" on a random direction each time it fires, like as it was impacting with the bullets. And the bullets seem to be impacting too, because they do spin randomly sometimes.

But when I print their groupIndexes, they are the same as the ship.

I'll do more tests today.
Last edited by kikito on Mon Apr 19, 2010 1:11 pm, edited 1 time in total.
When I write def I mean function.

### Who is online

Users browsing this forum: No registered users and 13 guests