Thank you!
I added the bullet. functions to the main.lua function, and that fixed the problem.
Search found 4 matches
- Thu Oct 24, 2024 12:33 am
- Forum: Support and Development
- Topic: HELP!! attempt to get length of global 'bullets' (a nil value)
- Replies: 6
- Views: 4535
- Thu Oct 17, 2024 2:40 pm
- Forum: Support and Development
- Topic: HELP!! attempt to get length of global 'bullets' (a nil value)
- Replies: 6
- Views: 4535
Re: HELP!! attempt to get length of global 'bullets' (a nil value)
Here is my code. I am using bullets as a table. function love.load() bullets = {} bullet.sprite = love.newImage('sprites/bullet.png') end function update(dt) end function love.keypressed(key) if key == 'space' then table.insert(bullets, { x = player.x, y = player.y, }) end end function love.draw() l...
- Wed Oct 16, 2024 1:49 am
- Forum: Games and Creations
- Topic: Short bullet hell, looking for feedback :)
- Replies: 5
- Views: 13008
Re: Short bullet hell, looking for feedback :)
Very good!
I know you made it so that you can't aim on purpose, but I think it would be really cool if either
1) you could aim or
2) the bullets that you shoot had very light auto aim, so that it would swerve toward your enemy a little.
Amazing game though!
I know you made it so that you can't aim on purpose, but I think it would be really cool if either
1) you could aim or
2) the bullets that you shoot had very light auto aim, so that it would swerve toward your enemy a little.
Amazing game though!
- Wed Oct 16, 2024 1:43 am
- Forum: Support and Development
- Topic: HELP!! attempt to get length of global 'bullets' (a nil value)
- Replies: 6
- Views: 4535
HELP!! attempt to get length of global 'bullets' (a nil value)
I can't figure out this error. I am pretty new to love2d. My knowledge is very limited. I would appreciate any guidance. Error bullet.lua:21: attempt to get length of global 'bullets' (a nil value) Traceback [love "callbacks.lua"]:228: in function 'handler' bullet.lua:21: in function 'draw...