Search found 219 matches

by darkfrei
Sat May 08, 2021 3:34 pm
Forum: Games and Creations
Topic: Double pendulum
Replies: 7
Views: 448

Re: Double pendulum

Second version:

Draw with lines, not points.

Press space to start.
by darkfrei
Fri May 07, 2021 10:59 pm
Forum: Games and Creations
Topic: Double pendulum
Replies: 7
Views: 448

Double pendulum

Hi all!

Here is my try to make a double pendulum (thanks for reddit):
by darkfrei
Fri May 07, 2021 8:54 pm
Forum: Games and Creations
Topic: Pathfinding with weights and walls
Replies: 5
Views: 426

Re: Pathfinding with weights and walls

Version 02: same as version 01, but fast calculation and it counts steps: 1145 steps for full solution. Possible optimization for next version: update path optimizations before searching new paths. pathfinding-one-02.love Upd: Yes, the version 03 needs just only 674 steps. 2021-05-07T23_04_34-Untitl...
by darkfrei
Fri May 07, 2021 7:44 am
Forum: General
Topic: What is your advice for saving game state?
Replies: 6
Views: 474

Re: What is your advice for saving game state?

I save some table data as table:

savefile.lua:

Code: Select all

return {
	player = {name = "Hero", health = 10, position = {x=4, y=8}},
	enemies = {
		{health = 8, position = {x=10, y=18}},
		{health = 12, position = {x=12, y=20}, hidden = true},
	}
}
And the

Code: Select all

save = require ('savefile')
to load it.
by darkfrei
Thu May 06, 2021 11:13 pm
Forum: Games and Creations
Topic: Pathfinding with weights and walls
Replies: 5
Views: 426

Re: Pathfinding with weights and walls

dusoft wrote: Thu May 06, 2021 8:50 pm Is that slow on purpose?
Yes, it's too fast for understanding by 60 fps.
by darkfrei
Thu May 06, 2021 5:37 pm
Forum: Games and Creations
Topic: Pathfinding with weights and walls
Replies: 5
Views: 426

Pathfinding with weights and walls

Hi all! My try to make a pathfinding (not A*), that can find the best maze solution. Here are 4 cells: yellow, that costs 0; dark yellow, that costs 1; dark dark yellow, that costs 2; dark dark dark blue, that costs 3, but not walkable :) Straight step costs 0.01; Side step (or direction changing) c...
by darkfrei
Thu May 06, 2021 6:36 am
Forum: Games and Creations
Topic: Don't learn to code - WesternPunk
Replies: 14
Views: 10957

Re: Don't learn to code - WesternPunk

I was sure that this thing is his hair, not eye.
by darkfrei
Wed May 05, 2021 2:43 am
Forum: Support and Development
Topic: [Solved] "Unmodifiable" table gets wiped after using it
Replies: 7
Views: 640

Re: "Unmodifiable" table gets wiped after using it

GVovkiv wrote: Tue May 04, 2021 4:22 pm Isn't it just copy content from table, without linking?
Uh, nevermind, it really just linked copy, my bad
And this was mine: https://love2d.org/forums/viewtopic.php ... 95#p238395
by darkfrei
Tue May 04, 2021 4:15 pm
Forum: Support and Development
Topic: [Solved] "Unmodifiable" table gets wiped after using it
Replies: 7
Views: 640

Re: "Unmodifiable" table gets wiped after using it

I need to keep "choices" unmodified, to reuse it later. local choices = {1,2,3,4} local choices2 = choices -- linked copy You are need a make a copy, not linked copy: local choices = {1,2,3,4} local choices2 = {} -- new table, not linked to the "choices" for i, v in pairs (choic...