Search found 209 matches

by sphyrth
Tue Sep 29, 2020 2:13 am
Forum: General
Topic: Debug with Lua, LOVE, VS Code
Replies: 2
Views: 5454

Re: Debug with Lua, LOVE, VS Code

I don't have a Rubber Duck with me, so I use that Inefficient Style you mentioned.
by sphyrth
Tue Sep 29, 2020 1:55 am
Forum: Games and Creations
Topic: Newbie's second game
Replies: 2
Views: 5248

Re: Newbie's second game

Clover wrote:
Tue Sep 29, 2020 12:04 am
The ball is too fast, i think you forgot to use dt to normalize it's speed :nyu:
I checked the source, and you're right:
pong.lua lines 33-35

Code: Select all

function love.update(dt)
	ball.x = ball.x + ball.vel.x
	ball.y = ball.y + ball.vel.y
	...
end
by sphyrth
Sun Sep 27, 2020 10:40 am
Forum: Games and Creations
Topic: Ice Slider - Released
Replies: 0
Views: 118

Ice Slider - Released

https://sphyrth.itch.io/ice-slider

Added mouse functions, but only for the menu.
by sphyrth
Fri Sep 25, 2020 2:05 pm
Forum: Games and Creations
Topic: Ice Slider (Alpha) - Phi Brain's Rink Slider Clone
Replies: 4
Views: 3634

Ice Slider (Beta Version)

I managed to overhaul this project, and I'm relatively happy with these improvements: - Before, you can get stuck in positions like these. Now, you can "Skip" your turn. Beta.png - The AI improved a bit; it still makes random decisions, but now it knows how to actually complete its turn. - The Tutor...
by sphyrth
Mon Sep 14, 2020 12:58 am
Forum: Support and Development
Topic: Getting a key as a number
Replies: 8
Views: 3346

Re: Getting a key as a number

Let's expand your code:

Code: Select all

var = {
  {}, -- var[1] A Table
  {}, -- var[2] Another Table
  {}  -- var[3] And yet another Table
}
For now, keep zorg's suggestion:

Code: Select all

var = {
  1, -- var[1] a number
  2, -- var[2] and so on
  3
}
by sphyrth
Mon Sep 14, 2020 12:35 am
Forum: Support and Development
Topic: Error main.lua:156: attempt to call field 'setBackroundColor' (a nil value)
Replies: 2
Views: 2426

Re: Error main.lua:156: attempt to call field 'setBackroundColor' (a nil value)

-- Wrong code love.graphics.setBackgroundColor('assets/sky.png') -- Either you draw your background as is: love.graphics.draw('assets/sky.png') -- Or use color values (I just searched for the generic RGB for sky blue) love.graphics.setBackgroundColor(135/255, 205/255, 235) P.S. Your assets are fine...
by sphyrth
Fri Sep 11, 2020 12:03 am
Forum: General
Topic: Why you get bugs & how to fix them [Youtube]
Replies: 4
Views: 4927

Re: Why you get bugs & how to fix them [Youtube]

I hope it's obvious that it's all in good fun, while I do use tabs myself I have no strong feeling for one or the other :D Oh, yes. That's why I laughed so much at your rant after saying "Do what works for you." :rofl: But the "For devs to read" is the argument that will sell me back to tabs. zorg'...
by sphyrth
Thu Sep 10, 2020 10:43 am
Forum: General
Topic: Why you get bugs & how to fix them [Youtube]
Replies: 4
Views: 4927

Re: Why you get bugs & how to fix them [Youtube]

1. It's useful even for me who already knows all this stuff. 2. The Tab>Space Rant made me lol. As a 2-Space Indentation Coder, the "Configurable Tabs" argument is what I'll remember when making big, open-source projects. But since all of my projects are small, I'm re-inforced to use Space: It's mai...
by sphyrth
Fri Sep 04, 2020 2:31 am
Forum: Support and Development
Topic: Tables and "for" statements
Replies: 4
Views: 2442

Re: Tables and "for" statements

Suppose this:

Code: Select all

my_table = { 'cat', 'dog', 'mouse', }
Untitled.png
Untitled.png (5.21 KiB) Viewed 2401 times
i returns the indexes of each item... namely 1 through 3.
v returns 'cat', 'dog', and 'mouse' for each cycle depending on their index.