Search found 191 matches

by nice
Thu Apr 29, 2021 8:23 am
Forum: General
Topic: [SOLVED] with making an OLD project work again
Replies: 8
Views: 6075

Re: [HELP] with making an OLD project work again

The way you did it still means that a fraction is the parameter you give to love.math.random; I meant moreso like this: -- pick some random colors trailPos = {} for i = 1, maxTrailSize do local c = {} c.r = love.math.random(255)/256 c.g = love.math.random(255)/256 c.b = love.math.random(255)/256 col...
by nice
Mon Apr 26, 2021 1:36 pm
Forum: General
Topic: [SOLVED] with making an OLD project work again
Replies: 8
Views: 6075

Re: [HELP] with making an OLD project work again

- use love.math.random instead of math.random, the latter is not actually seeded at game startup so it'll always give you the same sequence of numbers. You're an angel! So just to clarify, I need to exchange every math.random to love. math.random, am I correct? - (love.)math.random(1) does not do w...
by nice
Mon Apr 26, 2021 8:16 am
Forum: General
Topic: [SOLVED] with making an OLD project work again
Replies: 8
Views: 6075

[SOLVED] with making an OLD project work again

Hello everyone, I hope everyone is doing OK! So I want to add at start that I haven't used Löve2D/Lua in some time. I haven't kept up with the new changes to Löve2D, so I'm a bit rusty & I'm not fully aware if there are any changes to the forums rules. So to the question: I have an OLD project w...
by nice
Thu Aug 01, 2019 12:34 pm
Forum: Support and Development
Topic: Rotating around different points depending on controller input
Replies: 7
Views: 7766

Re: Rotating around different points depending on controller input

Pgimeno obviously has a better understanding of what you want to accomplish. From your initial post I could see how you could accomplish what you asked using ox and oy and applying an offset to the x and y coordinates. For the life of me, I can't visualize exactly how you want the mechanics to work...
by nice
Mon Jul 29, 2019 10:18 pm
Forum: Support and Development
Topic: Rotating around different points depending on controller input
Replies: 7
Views: 7766

Re: Rotating around different points depending on controller input

Interesting problem. I would probably use separate "left engine" and "right engine" settings which would be affected by the controls. Since you have position and angle, one way to solve this is to update both separately as if they were independent points, and then calculate the ...
by nice
Sun Jul 28, 2019 3:32 pm
Forum: Support and Development
Topic: Rotating around different points depending on controller input
Replies: 7
Views: 7766

Rotating around different points depending on controller input

Hello everone! I'm working on a "Tank" game where you control a Tank (top-down view) with a controller, where you turn in the game by holding down one of the individual triggers on a controller (in this case, an Xbox 360 controller). What I have right now What I have right now is that the ...
by nice
Mon Jun 17, 2019 4:45 pm
Forum: Support and Development
Topic: [HELP] Problem to understand how implement Joystick/Controller works
Replies: 1
Views: 4478

[HELP] Problem to understand how implement Joystick/Controller works

Hello everyone! I'm currently working on a game where I want to use a gamepad (in this case an Xbox 360 controller) where I have a square that I want to move using the triggers on the controller. But I have a problem understanding how to use "Joystick". How I want it to work is that I want...
by nice
Thu May 09, 2019 9:14 am
Forum: General
Topic: [SOLVED] Spawning/instantiating several objects on a grid
Replies: 6
Views: 5594

Re: [HELP] Spawning/instantiating several objects on a grid

Glad it works for you. You didn't mention that you wanted the trash items to be restricted to a random rectangle that includes the origin, though, and that looks like a weird requirement. Other than that, the method is the same I explained, and the caveat of the possibility that two trash items fal...
by nice
Wed May 08, 2019 7:10 am
Forum: General
Topic: [SOLVED] Spawning/instantiating several objects on a grid
Replies: 6
Views: 5594

Re: [HELP] Spawning/instantiating several objects on a grid

I asked a co-worker for suggestions and the solution to my problem is kinda easy. First off, I divide the local variables by 32 local minRandValueX = love.math.random(minX, halfWidth) / 32 local maxRandValueX = love.math.random(halfWidth, maxX) / 32 local minRandValueY = love.math.random(minY, halfH...
by nice
Tue May 07, 2019 11:23 am
Forum: General
Topic: [SOLVED] Spawning/instantiating several objects on a grid
Replies: 6
Views: 5594

[SOLVED] Spawning/instantiating several objects on a grid

Hello everyone! The game I'm working on a prototype where I have a player (white circle) that collects "trash" (a square with T) to protect "animals" that walks across the screen. A new piece of "trash" spawns on the screen when the Player collides with a "trash&qu...