Search found 114 matches
- Thu Jul 25, 2024 9:11 pm
- Forum: General
- Topic: How would I make an image flip over like a card
- Replies: 12
- Views: 28868
Re: How would I make an image flip over like a card
Change its scale from 1 to 0 and then display the backside with its scale changing from 0 to 1. Use the cosine function to make it more realistic. I attached a simple example.
- Thu May 30, 2024 9:43 pm
- Forum: General
- Topic: Help with calculating trajectory
- Replies: 13
- Views: 9580
Re: Help with calculating trajectory
If you don't want to do any of the math, then you can just simulate the shot. Take the table, the cue stick and the balls into an separate physics environment, do the shot there and if the white ball hits any other ball, then you have all the information you need to draw what you want: At the moment...
- Thu May 09, 2024 8:22 pm
- Forum: Support and Development
- Topic: [SOLVED] Game freezes fatally after only 20 seconds of gameplay
- Replies: 2
- Views: 1496
Re: Game freezes fatally after only 20 seconds of gameplay
The problem is, that you are loading the images thegovernment.jpg and textures/normal.png every frame. Load them once in love.load() like you do with the videos and music. This fixes the freeze for me.
- Sat May 04, 2024 10:05 pm
- Forum: Support and Development
- Topic: Bottons activating when I maintain them on touchscreen
- Replies: 3
- Views: 1523
Re: Bottons activating when I maintain them on touchscreen
Yeah but if I do that I would be able to maintain the jump button and have some sort of auto jump and I don't want that Then add a little state machine to prevent that: little_state_machine.png This could look something like this: function love.load() player.jumpingState = "isNotJumping" ...
Re: help cleaning up my code
I would suggest the opposite of BrotSagtMist: Create more functions that only contain 1-3 lines of code for better readability. As an example your function love.mousepressed() has 5 indentation levels. With some easy refactorings you can get this down to two or three and have an easier time to read ...
- Wed Dec 06, 2023 8:36 pm
- Forum: Support and Development
- Topic: Check if the web build is working every time a commit is pushed
- Replies: 2
- Views: 9153
Re: Check if the web build is working every time a commit is pushed
You can start chrome (or chromium based browsers) with debug output enabled ( source ): chromium --log-level=0 --enable-logging=stderr Then everything that is printed in the web console is also printed to the command line where chrome was started. Here an simple example javascript in a file called l...
- Tue Oct 17, 2023 8:58 pm
- Forum: Support and Development
- Topic: How to store file text into array
- Replies: 4
- Views: 5223
Re: How to store file text into array
In other words,what should I put at the ? So the condition is true when it access out of the string You need to put the following where the ? is: "" But why would you want to do that? You know that you are at the end of the string when i == #data[1] and you are "beyond" the stri...
- Sun Aug 13, 2023 8:20 pm
- Forum: Support and Development
- Topic: How would I go about making a flashlight effect in Love2D?
- Replies: 5
- Views: 1745
Re: How would I go about making a flashlight effect in Love2D?
I attached a simple example that works without shaders.
Thanks to SD.Chatane for the image (licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)).
Thanks to SD.Chatane for the image (licensed under Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0)).
- Sun Jun 25, 2023 7:46 pm
- Forum: Support and Development
- Topic: Timer as Integer ?
- Replies: 9
- Views: 1807
Re: Timer as Integer ?
You want the math.floor function: print(math.floor(19.02032)) -- prints "19" If you want commercial rounding you need to add 0.5 to your number before you use math.floor : function print_rounding(number, rounded_number) print("Rounding " .. tostring(number) .. " to " .....
- Fri Mar 10, 2023 5:08 pm
- Forum: General
- Topic: HTML+CSS UI Rendering
- Replies: 10
- Views: 6811
Re: HTML+CSS UI Rendering
I only came across LURE, [...] And I am confused, I do not know how to use it, there is nowhere at least a brief instruction on how to use it. You cannot use it (yet): LURE is currently under development and cannot yet produce rendered content. If you want to use Lua as a scripting language, but us...