Search found 188 matches

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: 3110

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: 3110

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 new position and ang...
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: 3110

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 rotation h...
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: 2383

[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 the input...
by nice
Thu May 09, 2019 9:14 am
Forum: General
Topic: [SOLVED] Spawning/instantiating several objects on a grid
Replies: 6
Views: 1707

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: 1707

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: 1707

[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" object on the screen. Here's a scree...
by nice
Mon Apr 15, 2019 6:49 am
Forum: General
Topic: [HELP] Drawable disappears the first frame
Replies: 3
Views: 6728

Re: [HELP] Drawable disappears the first frame

Usually, you want to set color before you draw something, not the other way around, it's more straightforward. And depending on what löve version you use, colors are in the [0,1] interval with the current versions, so {1 * 102, 1 * 51, 1 * 153, 1} is definitely wrong, unless you use something like ...
by nice
Sat Apr 13, 2019 8:24 am
Forum: General
Topic: [HELP] Drawable disappears the first frame
Replies: 3
Views: 6728

[HELP] Drawable disappears the first frame

Hello everyone! I'm gonna get straight into it, in this project I'm currently working on my drawable image in "player.lua" disappears as soon as the program starts. I'm a bit at a loss about what I should do. Usually, my solution is to set the color to white after I've drawn something but for some r...
by nice
Tue Apr 02, 2019 1:45 pm
Forum: General
Topic: [SOLVED] Applying velocity (on X-axis) to a physics body
Replies: 5
Views: 6464

Re: [HELP] Applying velocity (on X-axis) to a physics body

With box2d you don't want to set the position directly because it teleports the body (which is kind of pointless since it circumvents the physics system). Ideally you should use impulses and forces, this way your body will be able to react to collisions with other bodies. Furthermore, what you have...