Search found 126 matches

by 4vZEROv
Sat May 23, 2020 2:29 am
Forum: Support and Development
Topic: Drawing text filled with a texture instead of a solid color
Replies: 3
Views: 3088

Re: Drawing text filled with a texture instead of a solid color

Thanks! That's much neater. And it looks a lot like how I'd hoped the stencil I was trying at first would work. I'm going to have to throw that shader language on the pile of things I want to learn more about. Is there any introductory material for GLSL (with or without LÖVE) which you consider esp...
by 4vZEROv
Sat May 23, 2020 2:27 am
Forum: Support and Development
Topic: [ANSWERED] Question about My Method of Animation and Quads
Replies: 2
Views: 1734

Re: Question about My Method of Animation and Quads

First way, I don't like to call functions more than I need.
by 4vZEROv
Sat May 23, 2020 2:13 am
Forum: Support and Development
Topic: Can't get out of a loop in a function?
Replies: 4
Views: 3091

Re: Can't get out of a loop in a function?

You should try to use a library like: https://github.com/vrld/hump/blob/master/timer.lua It is made specialy to make it easy to do stuff like "after x time do that", "during x time do that" . if rollingTimer >= 1.5 then skillOut = math.random(0, player.skill01) if skillOut > t.di...
by 4vZEROv
Fri May 22, 2020 1:29 pm
Forum: Support and Development
Topic: Trying to create a camera like this game (Nuclear Throne).
Replies: 1
Views: 1710

Re: Trying to create a camera like this game (Nuclear Throne).

You can apply some lerp

Code: Select all

    function lerp(a, b, x) return a + (b - a) * x end
    local current_position = camera.getPos()
    local target_position = (player.pos * 5 + cursor.pos) / 6
    camera.setPos(current_position, target_position, 0.1)
by 4vZEROv
Thu May 21, 2020 10:43 pm
Forum: Support and Development
Topic: [SOLVED] Using a video crashes Love
Replies: 5
Views: 4388

Re: Using a video crashes Love

You are calling loading:play() every time love.update is called, it's called a lot of time. Do something like that function love.load() loading = love.graphics.newVideo('Loading.mp4') loading:play() end function love.update(dt) timer = timer + dt if timer > 10 and loading:isPlaying() then loaing:sto...
by 4vZEROv
Tue May 19, 2020 12:16 am
Forum: Support and Development
Topic: How to properly setup Love2D - LUA on Windows 10 ?
Replies: 8
Views: 5973

Re: How to properly setup Love2D - LUA on Windows 10 ?

I have the Löve launcher extension (by Jan Werber) in my Vscode. I configured the lovelauncher path variable to point to love.exe If you open a folder containing a main.lua file, press Alt + L and löve will be launched automatically. To have a console, create a conf.lua file next to your main.lua an...
by 4vZEROv
Mon May 18, 2020 4:51 pm
Forum: Support and Development
Topic: Help with spawning multiple objects
Replies: 5
Views: 3822

Re: Help with spawning multiple objects

The cs50 course really is that bad ... Your 'addBall()' function should : - create a ball with 'Ball:init()' - insert it inside the 'balls' table balls = {} function Ball:init(x, y, skin) self.skin = skin self.x = x self.y = y self.width = 8 self.height = 8 self.dy = 0 self.dx = 0 end function addBa...
by 4vZEROv
Sun May 10, 2020 6:14 pm
Forum: General
Topic: Help with multiball breaklout for the course cs50 intro to Game Development
Replies: 4
Views: 7291

Re: Help with multiball breaklout for the course cs50 intro to Game Development

Lua doesn't have class/states/instances/etc.. Lua only have values. A table is a value of type 'table'. A function is a value of type 'function'. A table can contain any value, so a table can contain any other table. To explain 'self' : local ball = {} ball.x = 0 -- To declare a function value belon...
by 4vZEROv
Sun May 10, 2020 1:57 am
Forum: General
Topic: How to correctly read text from keyboard
Replies: 7
Views: 8860

Re: How to correctly read text from keyboard

https://www.youtube.com/watch?v=-AQfQFcXac8

What do you want to do ?
What do your classes represent ?


To respond to the title of your post :
Callback :
https://love2d.org/wiki/love.keypressed

Inside love.update:
https://love2d.org/wiki/love.keyboard.isDown
by 4vZEROv
Sat May 09, 2020 12:33 pm
Forum: Support and Development
Topic: How do I make the screen have a glitchy effect
Replies: 2
Views: 2285

Re: How do I make the screen have a glitchy effect

You could use shaders to do that.
This website have a lot of them, with the source code: https://www.shadertoy.com/results?query=glitch

The syntax is nearly the same as love shaders (https://love2d.org/wiki/Shader) so you can convert it and it will work fine.