Search found 9 matches
- Thu Mar 20, 2025 8:42 pm
- Forum: Support and Development
- Topic: Camera doesn't follow the player, who gets stuck skating in the middle of the screen
- Replies: 0
- Views: 275
Camera doesn't follow the player, who gets stuck skating in the middle of the screen
Hello everyone. I'm having trouble understanding how to correctly deploy a map made with Tiled; the player walks, gets stuck in the middle of the screen, skating. I know there's something missing in the love.draw() function, in gameMap(), but I don't know what. I'm also not sure that "cam:lookA...
- Sat Oct 19, 2024 12:16 pm
- Forum: Support and Development
- Topic: anim8 nil value error in multi-scene project
- Replies: 5
- Views: 1646
Re: anim8 nil value error in multi-scene project
Thanks guys.
I'll work on it and post the results here.
I'll work on it and post the results here.
- Fri Oct 18, 2024 4:02 pm
- Forum: Support and Development
- Topic: anim8 nil value error in multi-scene project
- Replies: 5
- Views: 1646
Re: anim8 nil value error in multi-scene project
Thank you. Your explanation helped me a lot. Later I will try to create a function to change scenes as you said. I changed the beginning of the main.lua file and now it no longer gives an error, but when it reaches level1, the screen just goes black. main.lua require 'intro' require 'menu' require '...
- Fri Oct 18, 2024 2:12 pm
- Forum: Support and Development
- Topic: anim8 nil value error in multi-scene project
- Replies: 5
- Views: 1646
anim8 nil value error in multi-scene project
Hello, everyone. I'm starting a new game divided into several files, but I don't know exactly how to reference the anim8 library in it. When running the project below, the message "Error: player.lua:44: attempt to index field 'anim' (a nil value)" is displayed. I know it's something simple...
- Thu Sep 28, 2023 10:50 pm
- Forum: Support and Development
- Topic: isDown, keypressed or wasPressed?
- Replies: 9
- Views: 7779
Re: isDown, keypressed or wasPressed?
Although no error appears, the scene is not changed. Where is the error? You will need to use both love.update() to process updates and love.draw() to paint updates. Also: love.keypressed.(key) needs to become love.keypressed(key) Use some environment (IDE) that will announce (and fix) such typos a...
- Thu Sep 28, 2023 10:23 pm
- Forum: Support and Development
- Topic: isDown, keypressed or wasPressed?
- Replies: 9
- Views: 7779
Re: isDown, keypressed or wasPressed?
No error appears? I cant even count all the stuff wrong here. Aside from typos, the main thing is youre calling the tables not the functions. In fact, I had already corrected this error of calling tables instead of functions, but I ended up making the same mistake here on the forum. And I also made...
- Thu Sep 28, 2023 9:34 pm
- Forum: Support and Development
- Topic: isDown, keypressed or wasPressed?
- Replies: 9
- Views: 7779
Re: isDown, keypressed or wasPressed?
For one time events you only want to react the moment the key is pressed function love.keypressed(k) if k=="right" then next() end end and then have all your scene switch logic in its own function rather than having it scattered around in every scene. In this case we need two additional t...
- Thu Sep 28, 2023 7:14 pm
- Forum: Support and Development
- Topic: isDown, keypressed or wasPressed?
- Replies: 9
- Views: 7779
- Thu Sep 28, 2023 4:02 pm
- Forum: Support and Development
- Topic: isDown, keypressed or wasPressed?
- Replies: 9
- Views: 7779
isDown, keypressed or wasPressed?
I'm creating a text based game (with images) and I don't really know how to change the scene using the directional keys. When I use isDown, depending on the duration of pressing the key, the game skips the next scene. Example: function update_forest(dt) if love.keyboard.isDown('right') then scene = ...