Search found 1173 matches

by darkfrei
Fri Nov 10, 2023 8:06 pm
Forum: Support and Development
Topic: [solved] Animation - For Limit Must Be A Number
Replies: 10
Views: 10097

Re: Animation - For Limit Must Be A Number

What is imageHeight and imageWidth? Where it was defined?
by darkfrei
Thu Nov 09, 2023 11:23 am
Forum: Libraries and Tools
Topic: Buttons Barebone Library
Replies: 0
Views: 75735

Buttons Barebone Library

Hi all! There is a buttons barebone library, it supports what you want it to support. For example: -- main.lua local myButtons = require ('myButtons') function love.load() local color = {1,1,1} local function onButtonHovered (button) button.hovered = true button.lineWidth = 4 end local function onBu...
by darkfrei
Mon Nov 06, 2023 11:26 am
Forum: General
Topic: Code Doodles!
Replies: 196
Views: 262552

Re: Code Doodles!

Code doodle game about rolling of 5 dice: Press space to reroll table.unpack = table.unpack or unpack love.graphics.setFont(love.graphics.newFont (20)) dx = 20 local function random () return math.random (6) end local function getSumm () local value = 0 for i = 1, 5 do local dice = diceSet[i] value ...
by darkfrei
Wed Nov 01, 2023 8:06 am
Forum: Games and Creations
Topic: I published my first game with Love2d - Fire at Will (with source code)
Replies: 11
Views: 9880

Re: My first game with Love2d: Fire at Will

Maybe this site sell games with copyrights, not just a games as game copy?
by darkfrei
Sun Oct 29, 2023 11:16 am
Forum: Support and Development
Topic: Translating a 2D world into a retro 3D first person perspective
Replies: 1
Views: 3702

Re: Translating a 2D world into a retro 3D first person perspective

1. Create the same, but just with circles. Each circle has x,y position on map, radius on map. By the given player position and periscope direction, it can be recalculated as x position on the screen and radius un the screen. function love.load() Width, Height = love.graphics.getDimensions () MapCan...
by darkfrei
Sat Oct 28, 2023 2:45 pm
Forum: Support and Development
Topic: how to call an array to draw an object after a certain amount of DT has passed?
Replies: 2
Views: 8883

Re: how to call an array to draw an object after a certain amount of DT has passed?

im currently working on my first game, and i have a way to brute force a functionality thats good enough for this project, but with significantly more lines of code than id likely need if i could figure out how to call an array. Counter = 0 function love.load () require "enemy" enemy = En...
by darkfrei
Fri Oct 27, 2023 1:50 pm
Forum: Libraries and Tools
Topic: Parabola functions in Lua
Replies: 10
Views: 87810

Re: Parabola functions in Lua

Voronoi Fortune's Algorithm Animation in Lua. The code was reworked, works fine, but the circle event was replaced with beach line cleaning. --[[ Copyright 2023 darkfrei The MIT License https://opensource.org/license/mit/ <...> --]] local vfa = {} local function sortXYBackward (list) table.sort(list...
by darkfrei
Tue Oct 24, 2023 8:39 am
Forum: General
Topic: Gravity
Replies: 6
Views: 7319

Re: Gravity

F = m * a. m = mass. a = -9.8m/s^2 at ~ sea level (gravity). -> a = F/m. Given mass of your player, F is solved for. velocity is the integral of acceleration. If you are not familiar with calculus, calculate velocity incrementally each timestep (using dt) i.e. v = dt * a, where a (accel due to grav...
by darkfrei
Mon Oct 23, 2023 3:13 pm
Forum: General
Topic: Gravity
Replies: 6
Views: 7319

Re: Gravity

Hi ! I just started learning love2d and im making a smash bros like game with bump.lua but it hasn't gravity fonctionality. Can someone help me how to implement it please ? Just add the vertical acceleration multiple dt to you vertical velocity and than vertical velocity multiple dt to your vertica...
by darkfrei
Mon Oct 23, 2023 7:04 am
Forum: Support and Development
Topic: Is there a way to program constraints for resizable windows?
Replies: 4
Views: 6334

Re: Is there a way to program constraints for resizable windows?

I'd like to add minimum limits on the amount a Love2D window can be resized (e.g. shrunken so as not to obscure objects displayed in the viewport). Does anyone know if there is a way to set such constraints on a Love2D resizable window? Thanks 😊 Like this? https://love2d.org/wiki/love.graphics.scal...