Search found 511 matches
- Tue Dec 14, 2021 10:37 am
- Forum: Support and Development
- Topic: Use while true do loop?
- Replies: 3
- Views: 4056
Re: Use while true do loop?
A while loop will loop as long as the condition holds true. On the other hand, love.timer.sleep will halt the execution of the thread it's run on. If you put those two together, without a way for the while loop to exit, you have created an infinite loop that will also hang the thread due to all the ...
- Mon Dec 13, 2021 10:21 am
- Forum: Support and Development
- Topic: indexing a variable i don't know the name of
- Replies: 6
- Views: 3732
Re: indexing a variable i don't know the name of
I don't follow. What you're describing is that you want the input library's update() method to be invoked automatically, without the user messing around with it? What's the intended goal here, are you making something where user would be writing code?
- Fri Dec 10, 2021 11:14 am
- Forum: Support and Development
- Topic: joystick input handling problems
- Replies: 4
- Views: 3267
Re: joystick input handling problems
This code seems a bit convoluted, but at a glance I think the issue lies in this code is in how you're handling the "down" variable. You're looping through the buttons, and once it finds a hit, it will set that variable to 1. However, that doesn't stop that inner ipairs loop - so it will k...
- Thu Dec 02, 2021 10:40 pm
- Forum: General
- Topic: Struggling to get a pause screen working with HUMP
- Replies: 3
- Views: 3843
Re: Struggling to get a pause screen working with HUMP
I believe the issues lies with how you're defining the love.keypressed callback. You've defined it twice in two (or more) places, and only the one that is read last will be used, because redefining a löve callback will rewrite over the old. So, here it seems that gameLevel1.lua is the file that exec...
- Sun Nov 28, 2021 3:49 pm
- Forum: General
- Topic: Object-Oriented Programming in Love2D(Lua)
- Replies: 1
- Views: 4143
Re: Object-Oriented Programming in Love2D(Lua)
phpBB forums use [ code]...[ /code] tags for code, for future reference. Anyway, the problem seems to be with how you're calling the changeColor function: function Ball:checkEdges() if self.x + self.ballRadius > love.graphics.getWidth() or self.x - self.ballRadius < 0 then self.xSpeed = self.xSpeed ...
- Sun Nov 28, 2021 12:42 am
- Forum: General
- Topic: Have you coded a block chain for fun?
- Replies: 36
- Views: 20662
Re: Have you coded a block chain for fun?
Bitser is not cryptographically secure - it just allows you to encode and decode some data in non-destructive way, as it's a serializer. Not a way to (securely) encrypt data. If someone were to grab the data in transit, they could decode it with - you guessed it - bitser itself. Then they could just...
- Fri Nov 26, 2021 1:31 pm
- Forum: Support and Development
- Topic: ERROR Error Src/States/PlayState.lua:83: attempt to index field 'paddle' (a nil value)
- Replies: 2
- Views: 3334
Re: ERROR Error Src/States/PlayState.lua:83: attempt to index field 'paddle' (a nil value)
Please use [ code]...[ /code] tags when posting code. It's nigh unreadable otherwise. As for your actual problem, I see you have this line of code in your change() function: function PlayState:change(params) self.paddle = params.paddle -- assign the paddle -- ...rest of the code end I'm not sure how...
- Wed Nov 24, 2021 1:51 pm
- Forum: Support and Development
- Topic: Why can't I store this value in variable, yet I can use it normally?
- Replies: 3
- Views: 3897
Re: Why can't I store this value in variable, yet I can use it normally?
You can assign multiple return values from a function with the assignment operator, you just need to introduce additional variables. local p1x, p1y, p2x, p2y, p3x, p3y = objects.ground.body:getWorldPoints(objects.ground.shape:getPoints()) love.graphics.polygon("fill", p1x, p1y, p2x, p2y, p...
- Mon Nov 22, 2021 8:50 pm
- Forum: General
- Topic: Have you coded a block chain for fun?
- Replies: 36
- Views: 20662
Re: Have you coded a block chain for fun?
I think you're better off asking advice on how to make a block chain implementation in forums or places that are more geared towards the topic. The LÖVE forums do not strike me as such, and the other thread already sets a precedent that it can be a touchy topic around here - even if you aren't askin...
- Sun Nov 21, 2021 9:44 pm
- Forum: Support and Development
- Topic: How can I make open files when turning my game into .exe?
- Replies: 4
- Views: 4387
Re: How can I make open files when turning my game into .exe?
Another possible way to allow modifications is to make the game look for those files in the save folder, and load the files therein instead of the ones bundled within the fused exe. Just make sure appendidentity is set to false in your conf.lua.