Search found 576 matches

by ReFreezed
Sat Sep 24, 2022 9:11 pm
Forum: General
Topic: A way to do simple shadows
Replies: 20
Views: 602

Re: A way to do simple shadows

It's amazing how people can achieve something like this easly, while i myself sometimes might struggle with something like "soemthing = something1" instead of "something = something1" and unironically waste 10 mins trying to understand where i made mistake Heh, well you don't kn...
by ReFreezed
Sat Sep 24, 2022 7:28 pm
Forum: General
Topic: A way to do simple shadows
Replies: 20
Views: 602

Re: A way to do simple shadows

I spent some more time adding to the "example". It fixes the perspective issue pgimeno mentioned (using shaders, tears, and blood from an eldritch beast), and you can tweak the light's height and strength dynamically. I'd say the project has moved beyond simple at this point. Code is here:...
by ReFreezed
Thu Sep 22, 2022 8:00 pm
Forum: Games and Creations
Topic: Unexpected BUG in my first game
Replies: 19
Views: 588

Re: Unexpected BUG in my first game

Whoops, I used LÖVE 11.x instead of 0.10.x to run the game, so the colors were messed up. Disregard my previous comment.
by ReFreezed
Thu Sep 22, 2022 6:09 pm
Forum: Games and Creations
Topic: Unexpected BUG in my first game
Replies: 19
Views: 588

Re: Unexpected BUG in my first game

The biggest immediate problem is that text boxes seemingly have no text in them. (Never mind...)
by ReFreezed
Thu Sep 22, 2022 5:38 pm
Forum: Support and Development
Topic: Entity class can't read body variable
Replies: 1
Views: 85

Re: Entity class can't read body variable

'body'' and 'shape' are not variables in the function - they are fields in the table that you return. Move the body and shape creation to before the return statement to solve the issue: local body = love.physics.newBody(world, x, y, "dynamic") local shape = love.physics.newCircleShape(50) ...
by ReFreezed
Wed Sep 21, 2022 6:40 pm
Forum: General
Topic: A way to do simple shadows
Replies: 20
Views: 602

Re: A way to do simple shadows

Well, the sprites are flat, so all you can get are flat shadows. You'd need 3D geometry to some extent for more 3D-looking shadows. Since they look the most flat when the light comes from the side it could be a good idea to design your game/levels such that that situation doesn't happen.
by ReFreezed
Wed Sep 21, 2022 1:30 am
Forum: General
Topic: A way to do simple shadows
Replies: 20
Views: 602

Re: A way to do simple shadows

You can simply use the scale and shear arguments of love.graphics.draw() and some trigonometry to transform the shadow. Here's an example that handles a light source from any direction:
SimpleShadows.love
(3.23 KiB) Downloaded 18 times
_screenshot.png
_screenshot.png (46.23 KiB) Viewed 281 times
by ReFreezed
Tue Sep 20, 2022 1:34 pm
Forum: Support and Development
Topic: Calling Function from Collided Object in Windfield?
Replies: 8
Views: 335

Re: Calling Function from Collided Object in Windfield?

Just use another ipairs loop, something like this: function getYarrowByCollider(collider) for i, yarrow in ipairs(yarrows) do if yarrow.collider == collider then return yarrow end end return nil -- No yarrow found! end function playerInteract(x, y) local colliders = world:queryCircleArea(x, y, 10, {...
by ReFreezed
Mon Sep 19, 2022 3:26 pm
Forum: General
Topic: Midi Visualizer
Replies: 2
Views: 142

Re: Midi Visualizer

I would never have imagined "MIDI" and "boids" being in the same sentence. :d
by ReFreezed
Mon Sep 19, 2022 3:15 pm
Forum: General
Topic: Coroutines are awesome
Replies: 26
Views: 6721

Re: Coroutines are awesome

Interesting example about visualizing algorithms. I was mainly thinking about games, but I see how coroutines could work in other simpler programs. Not sure specifically the rendering fits well there though as you could just render stuff and call love.graphics.present() whenever you want in the midd...