Search found 260 matches

by sphyrth
Wed Sep 30, 2020 11:53 pm
Forum: Support and Development
Topic: [Solved]Making a character switch images when pressing a button to move
Replies: 3
Views: 2939

Re: Making a character switch images when pressing a button to move

TurtlyDz wrote: Wed Sep 30, 2020 8:34 pm If you need me to attach the game files just tell me.
Please do. There are several ways of solving your problem.
by sphyrth
Tue Sep 29, 2020 2:13 am
Forum: General
Topic: Debug with Lua, LOVE, VS Code
Replies: 3
Views: 18327

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: 9545

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: 4
Views: 7094

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: 8326

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. -...
by sphyrth
Mon Sep 14, 2020 12:58 am
Forum: Support and Development
Topic: Getting a key as a number
Replies: 8
Views: 7336

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: 4245

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: 8017

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...
by sphyrth
Thu Sep 10, 2020 10:43 am
Forum: General
Topic: Why you get bugs & how to fix them [Youtube]
Replies: 4
Views: 8017

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...
by sphyrth
Fri Sep 04, 2020 2:31 am
Forum: Support and Development
Topic: Tables and "for" statements
Replies: 3
Views: 5043

Re: Tables and "for" statements

Suppose this:

Code: Select all

my_table = { 'cat', 'dog', 'mouse', }
Untitled.png
Untitled.png (5.21 KiB) Viewed 5002 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.