Search found 80 matches

by Xugro
Sat Oct 17, 2020 7:00 pm
Forum: Support and Development
Topic: I searched but no answer so I have to come here and asking this coding problem
Replies: 9
Views: 447

Re: I searched but no answer so I have to come here and asking this coding problem

Personally: I do not know. Can you expand on this: What do you want to achieve? I mean, like: somewords=love.graphics.newText(...) somewords=somewords:setf(wraplimit), not include using a new text to replace original text. or just: somewords=love.graphics.newFormatText(...) Okay, that I understand....
by Xugro
Fri Oct 16, 2020 8:08 pm
Forum: Support and Development
Topic: I searched but no answer so I have to come here and asking this coding problem
Replies: 9
Views: 447

Re: I searched but no answer so I have to come here and asking this coding problem

always report argument #3 to 'setf' (string expected, got no value) If you take a look at the wiki entry for Text:setf : You need to give the function three parameters: The new text to draw The number of pixels before wrapping And the alignment of the text (left, right center or justify) The error ...
by Xugro
Mon Oct 12, 2020 5:23 pm
Forum: Support and Development
Topic: COINS & HURDLES
Replies: 7
Views: 320

Re: COINS & HURDLES

You have to init the CoinSeries. If you dont there are no coins in the coins-list. And therefore no coins will be rendered.
by Xugro
Sun Oct 11, 2020 5:06 pm
Forum: Support and Development
Topic: COINS & HURDLES
Replies: 7
Views: 320

Re: COINS & HURDLES

You use the init-function of the coin to set its position. Create a(n additional) constructor where you can give the coin the x-position you want it to have: function Coin:initWithX(x) self.x = x self.y = 600 self.width = Coin_image:getWidth() self.height = 32 end Now create a CoinSeries-Object, tha...
by Xugro
Sat Oct 10, 2020 9:37 pm
Forum: Support and Development
Topic: COINS & HURDLES
Replies: 7
Views: 320

Re: COINS & HURDLES

Could you upload a .love file of your project and a small sketch of what you want please? That would make it much easier for us to help you. I am not sure what you want. If I had to guess: You want a coin block that has multiple coins inside. Something like this: https://www.youtube.com/watch?v=qovH...
by Xugro
Wed Oct 07, 2020 7:32 pm
Forum: Games and Creations
Topic: Collisions and images
Replies: 6
Views: 274

Re: Collisions and images

It sounds like you are using AABB Collision Detection. That should work. What is the problem with your collision detection? My first guess would be that your bullets are too fast, but there can be others problems. Here is a short article about AABB Collision Detection: https://tutorialedge.net/gamed...
by Xugro
Mon Oct 05, 2020 9:26 pm
Forum: Support and Development
Topic: make line dissapear after 'x' seconds
Replies: 1
Views: 141

Re: make line dissapear after 'x' seconds

To make the line disappear after x seconds. Save the remaining time in a variable and reduce it in love.update until it is zero (or less). If this happens delete the line: function love.load() remaining_time = x end function love.update(dt) remaining_time = remaining_time - dt if remaining_time <= 0...
by Xugro
Sun Oct 04, 2020 9:41 am
Forum: Support and Development
Topic: Square Color Picker
Replies: 9
Views: 323

Re: Square Color Picker

pgimeno wrote:
Sat Oct 03, 2020 11:31 pm
I'd suggest using ImageData (and its mapPixel method) for this purpose instead of a canvas.
That's a really good idea. I did not know that this method existed.

After a small test: The code is much cleaner and about 300x faster.
by Xugro
Sat Oct 03, 2020 8:28 pm
Forum: Support and Development
Topic: Square Color Picker
Replies: 9
Views: 323

Re: Square Color Picker

Yeah, sure. The code is not the prettiest nor the fastest, but it is working.
by Xugro
Sat Oct 03, 2020 7:32 pm
Forum: Support and Development
Topic: Square Color Picker
Replies: 9
Views: 323

Re: Square Color Picker

Create a square canvas. For a certain hue draw all saturation (x-axis) and brightness (y-axis) levels with two for-loops. Create another canvas and draw all possible hues (e.g. y-axis). Draw those two canvases to the screen. When the user clicks on the saturation-brightness-square: Choose the color ...