Search found 39 matches

by Azzla
Fri Mar 10, 2023 7:29 pm
Forum: Support and Development
Topic: Error main.lua:29: attempt to index global 'mole' (a nil value) Traceback [love "callbacks.lua"]:228: in function 'h
Replies: 4
Views: 1655

Re: Error main.lua:29: attempt to index global 'mole' (a nil value) Traceback [love "callbacks.lua"]:228: in functio

As you don't have any update logic yet, mole will always be wherever you spawn it, in this case 100, 500. Since you are new to love, one simple but effective suggestion I have is that hard-coded integers are usually not going to be helpful down the road. Consider something like the following: --keep...
by Azzla
Mon Jul 25, 2022 6:08 am
Forum: Support and Development
Topic: [SOLVED] Problem Translating Bullet Vector Relative to Player's Angle
Replies: 3
Views: 2290

Re: Problem Translating Bullet Vector Relative to Player's Angle

Anyway, here's a small project that could help you understand how to solve the problem. (See the attachment.) It is honestly embarrassing how simple this looks, after I spent an entire day banging my head against it to no avail. The elusive chunk of code I needed: local handDistance = math.sqrt(HAN...
by Azzla
Sun Jul 24, 2022 2:36 am
Forum: Support and Development
Topic: [SOLVED] Problem Translating Bullet Vector Relative to Player's Angle
Replies: 3
Views: 2290

[SOLVED] Problem Translating Bullet Vector Relative to Player's Angle

In my top-down shooter, the player holds a gun in their right hand, and bullets need to spawn from that location regardless of the player's angle. I stumbled across this thread and this thread , however both of these seem vastly overcomplicated for what I'm trying to achieve (I tried both anyway and...
by Azzla
Wed May 11, 2022 7:31 pm
Forum: Support and Development
Topic: score counter and putting objects to collect
Replies: 14
Views: 11653

Re: score counter and putting objects to collect

Hi - I'm somewhat new to coding and wondering about the same issue of object collection. For some reason when I download the two .love files in the thread above, I'm not able to open them, with love or with VSC. If anyone can advise me on a possible solution so I can benefit from the advice/help al...
by Azzla
Wed May 11, 2022 6:57 pm
Forum: Support and Development
Topic: Particle System :setColors Has No Effect on Sprite [Solved]
Replies: 2
Views: 1838

Re: Particle System :setColors Has No Effect on Sprite

The colors of the pixels in the texture are multiplied with the colors set by :setColors() (and love.graphics.setColor). The texture has to be grayscale if you want to control the color with :setColors() exclusively. Technically you can change the color in any way you want with custom shaders, but ...
by Azzla
Wed May 11, 2022 1:01 am
Forum: Support and Development
Topic: Particle System :setColors Has No Effect on Sprite [Solved]
Replies: 2
Views: 1838

Particle System :setColors Has No Effect on Sprite [Solved]

Hi, I'm trying to figure out how the :setColors method for particle systems works. The documentation seems to imply this method will override the colors from the initial sprite ("apply them to the sprite" ?) and use the specified values instead, but I've not seen any effect. My game is a p...
by Azzla
Mon Mar 30, 2020 4:17 am
Forum: Support and Development
Topic: Particle System won't emit properly.
Replies: 3
Views: 4148

Re: Particle System won't emit properly.

-- spawn particles local direction = 0 local increment = (math.pi*2) / numberOfParticles for i = 1, numberOfParticles do psystem:setDirection ( direction ) psystem:emit (1) direction = direction + increment end So essentially instead of using setLinearAcceleration(), you manually go through the ang...
by Azzla
Sun Mar 29, 2020 3:14 am
Forum: Support and Development
Topic: Particle System won't emit properly.
Replies: 3
Views: 4148

Particle System won't emit properly.

Hi. I've been working on my first LOVE2D project for a week or so and I'm trying to add some simple particle effects to the game. The problem is that every emission call during the game results in particles shooting out on a specific axis , while the particles should just shoot out of the zombie's p...