Lsokoban level editor for Windows
Moderators: Shine, Insert_witty_name
Lsokoban level editor for Windows
Hi guys,
Just wanted to let you know I threw together a quick level editor for making new Lsokoban levels. It's very basic and only allows you to save files not load them but I think it's more than enough to whip out a couple levels in no time flat.
Just remember to save them to /levels directory and give them the next number up. If you want to share any levels post them here and I'll include them in the future.
http://stuff.hyperpixel.net/leveleditor.zip
Here's a new map for level 5
gamefield = {
0,1,1,1,1,0,0,0,0,1,1,1,1,0,
1,-2,-2,0,0,1,0,0,1,0,0,-2,-2,1,
1,-2,2,0,2,0,1,1,0,2,0,2,-2,1,
0,1,0,2,0,2,0,0,2,0,2,0,1,0,
0,0,1,0,0,0,0,0,0,0,0,1,0,0,
0,0,0,1,-2,0,1,1,0,-2,1,0,0,0,
0,0,0,0,1,0,-1,0,0,1,0,0,0,0,
0,0,0,0,0,1,1,1,1,0,0,0,0,0
}
Just wanted to let you know I threw together a quick level editor for making new Lsokoban levels. It's very basic and only allows you to save files not load them but I think it's more than enough to whip out a couple levels in no time flat.
Just remember to save them to /levels directory and give them the next number up. If you want to share any levels post them here and I'll include them in the future.
http://stuff.hyperpixel.net/leveleditor.zip
Here's a new map for level 5
gamefield = {
0,1,1,1,1,0,0,0,0,1,1,1,1,0,
1,-2,-2,0,0,1,0,0,1,0,0,-2,-2,1,
1,-2,2,0,2,0,1,1,0,2,0,2,-2,1,
0,1,0,2,0,2,0,0,2,0,2,0,1,0,
0,0,1,0,0,0,0,0,0,0,0,1,0,0,
0,0,0,1,-2,0,1,1,0,-2,1,0,0,0,
0,0,0,0,1,0,-1,0,0,1,0,0,0,0,
0,0,0,0,0,1,1,1,1,0,0,0,0,0
}
Carl,
I am relatively new to Sokoban puzzle. Now, I have played the puzzle using Sokoban YASC (for Windows). I seemed to like it. Thought I would convert Skinner's Microban levels (the first 10) using your LevelEditor. They perfectly fit in your LSokoban's screen (8 by 14 tiles). You (and others) can get it at my webpage. The levels are good for beginners. Try them, huh?
Do you plan to upgrade your LevelEditor such as clearing all tiles, opening previous levels for re-editing, saving files with a new name, etc.?
With those features, I'll go ahead to add more levels to Skinner's Microban.
Thanks.
I am relatively new to Sokoban puzzle. Now, I have played the puzzle using Sokoban YASC (for Windows). I seemed to like it. Thought I would convert Skinner's Microban levels (the first 10) using your LevelEditor. They perfectly fit in your LSokoban's screen (8 by 14 tiles). You (and others) can get it at my webpage. The levels are good for beginners. Try them, huh?
Do you plan to upgrade your LevelEditor such as clearing all tiles, opening previous levels for re-editing, saving files with a new name, etc.?
With those features, I'll go ahead to add more levels to Skinner's Microban.
Thanks.
Geo Massar
Retired Engineer
Retired Engineer
Thanks for the levels and feedback.
I think I can add everything you requested.. It was basically a quick hack to get a level editor working (~15 minutes in visual basic).
I'm gonna play those levels now and add then into the rotation.
One question, what do you mean by save as a different name?
Like a save as command on the file menu?
I think I can add everything you requested.. It was basically a quick hack to get a level editor working (~15 minutes in visual basic).
I'm gonna play those levels now and add then into the rotation.
One question, what do you mean by save as a different name?
Like a save as command on the file menu?
Yes, just like a regular editor.
I have somewhat trouble with moving player around. Sometimes the player steps twice when I meant a single step. Maybe it was my PSP but I tested the motion on LP for Windows, the same effect. Maybe, modify your code as to keep single steps, one a time just like Shine's calculator.
Have fun!
I have somewhat trouble with moving player around. Sometimes the player steps twice when I meant a single step. Maybe it was my PSP but I tested the motion on LP for Windows, the same effect. Maybe, modify your code as to keep single steps, one a time just like Shine's calculator.
Have fun!
Geo Massar
Retired Engineer
Retired Engineer
Yep.
I just deliberately wrote a movetest script to see how the motion is improving. Here is a pair of codes, before and after versions, to get an idea.
Before version ...
And, the after version ...
The after version works much better but yet you have to press the same key repeatedly if you want to move the player in the same direction. Maybe, need more improvement. I'll try it once more and will let you know if you are interested.
I just deliberately wrote a movetest script to see how the motion is improving. Here is a pair of codes, before and after versions, to get an idea.
Before version ...
Code: Select all
-- movetest.lua by Geo Massar
function move()
local pad = Controls.read()
if pad:right() then
playerPos = playerPos + 1
if playerPos > 13 then playerPos = 13 end
end
if pad:left() then
playerPos = playerPos - 1
if playerPos < 1 then playerPos = 1 end
end
end
player = Image.load "player.png"
playerPos = 1
while true do
screen:clear()
move()
screen:blit(32*playerPos, 120, player)
screen.waitVblankStart(5)
screen:flip()
end
Code: Select all
function move()
local pad = Controls.read()
if pad ~= oldpad then
if pad:right() then
playerPos = playerPos + 1
if playerPos > 13 then playerPos = 13 end
end
if pad:left() then
playerPos = playerPos - 1
if playerPos < 1 then playerPos = 1 end
end
oldpad = pad
end
end
Geo Massar
Retired Engineer
Retired Engineer
I got the working model. Let me know what you think.
Further improved...
I'll call it a night. See ya tmw if you are around. :)
Further improved...
Code: Select all
-- movetest.lua by Geo Massar
function move()
local pad = Controls.read()
if (pad ~= oldpad) or (countpads > 5) then -- adjust the count limit as needed
if pad:right() then
playerPos = playerPos + 1
if playerPos > 13 then playerPos = 13 end
end
if pad:left() then
playerPos = playerPos - 1
if playerPos < 1 then playerPos = 1 end
end
oldpad = pad
countpads = 0
else
countpads = countpads + 1
end
end
player = Image.load "player.png"
playerPos = 1
countpads = 0
while true do
screen:clear()
move()
screen:blit(32*playerPos, 120, player)
screen.waitVblankStart() -- remove the 5 as it seems unnessary.
screen:flip()
end
Geo Massar
Retired Engineer
Retired Engineer
Carl,
I have modded your Lsokoban with the repeating mechanism mentioned in the other thread: http://forums.ps2dev.org/viewtopic.php?t=3423
It works flawless except the wierd bug you mentioned earlier. I'll try to solve it (I think I know the solution.)
I have added 10 more levels to Skinner's list. It is available in my webpage.
Thanks for the great puzzle in spite of its being a clone.
I have modded your Lsokoban with the repeating mechanism mentioned in the other thread: http://forums.ps2dev.org/viewtopic.php?t=3423
It works flawless except the wierd bug you mentioned earlier. I'll try to solve it (I think I know the solution.)
I have added 10 more levels to Skinner's list. It is available in my webpage.
Thanks for the great puzzle in spite of its being a clone.
Geo Massar
Retired Engineer
Retired Engineer
Here is the solution I think you might want to mod your LSokoban.
The code below is to load all levels at once and store them in a table (an array). For checkout, it prints all levels on the console using LP-Win32.
Use Lua's dostring() instead of dofile() to read one level a time into the system. Eq:
dostring(gamefields[level])
The "wierd bug" will be gone forever!
Have fun!
PS Triggers on PSP should advance levels at lightening speed.
The code below is to load all levels at once and store them in a table (an array). For checkout, it prints all levels on the console using LP-Win32.
Use Lua's dostring() instead of dofile() to read one level a time into the system. Eq:
dostring(gamefields[level])
The "wierd bug" will be gone forever!
Have fun!
PS Triggers on PSP should advance levels at lightening speed.
Code: Select all
-- levelloader.lua by Geo Massar, 2005
gamefields = {}
level = 1
while true do
levelfile = string.format("Levels/%d.lua", level)
f = io.open(levelfile) -- as read by default
if f then
print("Reading "..levelfile)
gamefield = f:read("*all")
table.insert(gamefields, gamefield)
level = level + 1
else
break -- no more left
end
end
for level = 1, table.getn(gamefields) do
print()
print("Level "..level)
print "--------------------"
io.write(gamefields[level])
end
Geo Massar
Retired Engineer
Retired Engineer
added some of the new stuff you wanted.
http://stuff.hyperpixel.net/editor.zip
just replace the exe with this one.
http://stuff.hyperpixel.net/editor.zip
just replace the exe with this one.
Thanks for the modded editor. Will the next version include opening files for re-editting?
For your reward, I have added 10 more levels (total is 30 so far.)
However, I am rather unable to verify the last 10 levels due to the "wierd bug". Hope you would fix it soon.
There are about 100 levels available. As soon as the bug is killed, I 'll add many more levels in return. :)
For your reward, I have added 10 more levels (total is 30 so far.)
However, I am rather unable to verify the last 10 levels due to the "wierd bug". Hope you would fix it soon.
There are about 100 levels available. As soon as the bug is killed, I 'll add many more levels in return. :)
Geo Massar
Retired Engineer
Retired Engineer
http://stuff.hyperpixel.net/lsokoban.zip
Version 0.5 with 29 playable levels and the control fix thanks to Geo
Version 0.5 with 29 playable levels and the control fix thanks to Geo