Search found 8 matches

by W3LF
Sun Feb 14, 2016 3:07 pm
Forum: Support and Development
Topic: Bullets that don't shoot.
Replies: 9
Views: 5608

Re: Bullets that don't shoot.

MadByte wrote:Take a look at this basic shooting example:
bulletExample.love
It should make clear what is going wrong with your code.
Thanks a lot :D
by W3LF
Sat Feb 13, 2016 3:19 pm
Forum: Support and Development
Topic: Bullets that don't shoot.
Replies: 9
Views: 5608

Re: Bullets that don't shoot.

This part: function bullet.update(dt) for i,v in ipairs(bullet) do v.x = v.x + (v.dx * dt) v.y = v.y + (v.dy * dt) end end v would be bullet , but bullet does not have any members with number keys (only speed, x, y, etc...), and even if it would, they would still lack the dx and dy keys. The fact i...
by W3LF
Sat Feb 13, 2016 8:26 am
Forum: Support and Development
Topic: Bullets that don't shoot.
Replies: 9
Views: 5608

Re: Bullets that don't shoot.

zorg wrote:I also see in the pastebin snippet that you define bullet.speed, but nowhere are any numeric keys defined inside bullet, much less a dx or dy member for them.

Code: Select all

local bulletDx = bullet.speed * math.cos(angle)
local bulletDy = bullet.speed * math.sin(angle)
I don't get what you mean, sorry :c
by W3LF
Sat Feb 13, 2016 8:24 am
Forum: Support and Development
Topic: [SOLVED]Simple Countdown doesnt work.
Replies: 5
Views: 4804

Re: Simple Countdown doesnt work.

zorg wrote:

Code: Select all

 These kind of tags: [code]
[/code]
Oh, alright, sorry.
by W3LF
Fri Feb 12, 2016 6:19 pm
Forum: Support and Development
Topic: Bullets that don't shoot.
Replies: 9
Views: 5608

Re: Bullets that don't shoot.

The pastebin code looks fine. I didn't read the rest but function UPDATE_BULLET(dt) bullet.update() love.mousepressed() end Should be: function UPDATE_BULLET(dt) bullet.update(dt) love.mousepressed(x, y, button) -- not sure what args you would pass there end Thanks for the help, but it still doesn'...
by W3LF
Fri Feb 12, 2016 5:30 pm
Forum: Support and Development
Topic: Bullets that don't shoot.
Replies: 9
Views: 5608

Bullets that don't shoot.

Hi again, i'm having a bit of troubles with bullets. I followed a tutorial on love's wiki, but they don't want to work. Here is my code: bullet.lua (i think the problem is here): http://pastebin.com/MafSWDak Or if you want, a .love file with the entire code: https://www.dropbox.com/s/m5fc58iqm8dww7u...
by W3LF
Fri Feb 12, 2016 9:05 am
Forum: Support and Development
Topic: [SOLVED]Simple Countdown doesnt work.
Replies: 5
Views: 4804

Re: Simple Countdown doesnt work.

Uh, i'm so stupid.

Btw, I use tags, it's just Copy-Paste's effect, i'll be more careful next time :D
by W3LF
Fri Feb 12, 2016 8:56 am
Forum: Support and Development
Topic: [SOLVED]Simple Countdown doesnt work.
Replies: 5
Views: 4804

[SOLVED]Simple Countdown doesnt work.

Hello everybody, I'm new to Lua programming. I'm trying to work on a simple countdown, but Love gives me an error: -- Error Syntax Error: main.lua:16: 'then' expected near '=' -- here is my simple code: function love.load() love.graphics.setBackgroundColor(255, 255, 255) totalTime = 30 gameOver = fa...