Help implementing game logic from fish fillets

General discussion about LÖVE, Lua, game development, puns, and unicorns.
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

darkfrei wrote: Mon Feb 14, 2022 11:59 am
glitchapp wrote: Mon Feb 14, 2022 8:47 am By the way I just suppose you draw the fish yourself?
Yes, it's my graphics :) Used mouse, paint dot net and about 5 minutes time :)
The blue fish is just stretched up the gold one, than a little bit reworked.
Cool, your graphics are going to be famous :awesome:

I've been busy but I haven't finished with the game yet.
pgimeno wrote: Sun Feb 13, 2022 2:38 pm Here are the first three levels:

Code: Select all

local levels = {
 { width = 29, layout = [[
...............A.............
.............##A##...........
..............#A#............
..............#A#............
.####.........#A#.....##...##
#####.....#####A#...#########
###############A#############
###############A#############
###########.....#############
#######...........###########
####.................########
###....................######
###....................######
###.....................#####
###......................####
###........................##
###.........................!
###....a111........4444b....!
###....accc.ddddddd4444b....!
####...aaaa..d...d..bbbb....!
#####..a..a..d...d..b..b..###
#######a..a..d...d..b..b.####
#############################
#############################
#############################
#############################
]]}, { width = 48, layout = [[
.####...........................................
..######........#######.........................
...#####################.....###.......##.......
#....#############################..#######.....
#.111.#######################################...
#.............#####......####..###############..
##.2222.........##...............###############
###2222...aaaaaaaa...............###############
###.......aaaaaaaa....................##########
####......aaaaaaaa.....................#########
#################.......................########
#################.......................########
#################........................#######
####.....########........................#######
##.......####################.............######
#...........b..#############..............######
#..........bb...############...##.........######
#..........bb...############...####.......######
#..........##...####...#ccc#A..####.......######
##...............#......ccc.A.####........######
#####............#......ccc.A..###........######
##...............#......ccc.A..##.........######
#.......................ccc.A.............######
#....e...................d..AA...........#######
#....eeee................####............#######
##...e...................####...........########
######.......BB..........######........#########
##.........fffff.........########....###########
#..........ff....#.......#######################
#..........fffff##....##.#######################
#............#####....##########################
#...............##....##########################
##...............#.....###################.....!
##...............#........#############........!
####...........####............................!
####################........................####
################################################
]]}, { width = 40, layout = [[
########################################
########################################
############......A......######.....####
#########.#.......A.......#...........##
########........#####..................#
######.............##..........###.....#
#####..................................#
######.......#...#########............##
#######......##.###########.aaa......###
########......#.#....########........###
###..###.............####...........####
##....b##............#..............####
##....b########.#....##.......B......###
##....b.#########....####..BBBBBBBBB.###
##....b.########.....#####......##...###
##....b...####........##........########
#.....b...............##..........######
#.....b...............###...........####
#.....b..............####............###
#.....##################.............###
#.....................C#.............###
!.....................c............#####
!.....................########....######
###.#########################......#####
##.......#ddddd........######ee.......##
##.........D..d..........####ee........#
#..........D..............###ee........#
#....f.....##...............#gg........#
#...hh...####.#..............gg........#
#.iiiii..######.......jj.....gg........#
#.111....#######......jj...####........#
#....4444##########...jj..#####.......##
#####4444######################......###
################################...#####
########################################
]]}
Pgimeno, I used your tables to implement the next levels, which software did you use to capture the levels? Great work they are exactly like the originals! Can you do all of them please :joker:

There are three playable levels now!
Attachments
luasok.love
(612.18 KiB) Downloaded 119 times
User avatar
darkfrei
Party member
Posts: 1204
Joined: Sat Feb 08, 2020 11:09 pm

Re: Help implementing game logic from fish fillets

Post by darkfrei »

Maybe here:
http://fillets.sourceforge.net/download.php

Yes, here:
http://fillets.sourceforge.net/download ... w%20build)
fillets-ng-all-win32-1.0.1\script\start\models.lua

Code: Select all

room = addModel("item_fixed", 0, 0,
[[
.............................
.............XX.XX...........
..............X.X............
..............X.X............
.XXXX.........X.X.....XX.X.XX
XXXXX.....XXXXX.X...XXXXXXXXX
XXXXXXXXXXXXXXX.XXXXXXXXXXXXX
XXXXXXXXXXXXXXX.XXXXXXXXXXXXX
XXXXXXXXXXX.....XXXXXXXXXXXXX
XXXXXXX...........XXXXXXXXXXX
XXXX.................XXXXXXXX
XXX....................XXXXXX
XXX....................XXXXXX
XXX.....................XXXXX
XXX......................XXXX
XXX........................XX
XXX..........................
XXX..........................
XXX..........................
XXXX.........................
XXXXX.....................XXX
XXXXXXX..................XXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
]])
briefcase:

Code: Select all

room = addModel("item_fixed", 0, 0,
[[
.XXXX...........................................
..XXXXXX........XXXXXXX.........................
...XXXXXXXXXXXXXXXXXXXXX.....XXX.......XX.......
X....XXXXXXXXXXXXXXXXXXXXXXXXXXXXX..XXXXXXX.....
X.....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
X.............XXXXX......XXXX..XXXXXXXXXXXXXXX..
XX..............XX...............XXXXXXXXXXXXXXX
XXX..............................XXXXXXXXXXXXXXX
XXX...................................XXXXXXXXXX
XXXX...................................XXXXXXXXX
XXXXXXXXXXXXXXXXX.......................XXXXXXXX
XXXXXXXXXXXXXXXXX.......................XXXXXXXX
XXXXXXXXXXXXXXXXX........................XXXXXXX
XXXX.....XXXXXXXX........................XXXXXXX
XX.......XXXXXXXXXXXXXXXXXXXX.............XXXXXX
X..............XXXXXXXXXXXXX..............XXXXXX
X...............XXXXXXXXXXXX...XX.........XXXXXX
X...............XXXXXXXXXXXX...XXXX.......XXXXXX
X..........XX...XXXX...X...X...XXXX.......XXXXXX
XX...............X............XXXX........XXXXXX
XXXXX............X.............XXX........XXXXXX
XX...............X.............XX.........XXXXXX
X.........................................XXXXXX
X........................................XXXXXXX
X........................XXXX............XXXXXXX
XX.......................XXXX...........XXXXXXXX
XXXXXX...................XXXXXX........XXXXXXXXX
XX.......................XXXXXXXX....XXXXXXXXXXX
X................X.......XXXXXXXXXXXXXXXXXXXXXXX
X...............XX....XX.XXXXXXXXXXXXXXXXXXXXXXX
X............XXXXX....XXXXXXXXXXXXXXXXXXXXXXXXXX
X...............XX....XXXXXXXXXXXXXXXXXXXXXXXXXX
XX...............X.....XXXXXXXXXXXXXXXXXXX......
XX...............X........XXXXXXXXXXXXX.........
XXXX...........XXXX.............................
XXXXXXXXXXXXXXXXXXXX........................XXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
]])
cellar:

Code: Select all

room = addModel("item_fixed", 0, 0,
[[
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXX.............XXXXXX.....XXXX
XXXXXXXXX.X...............X...........XX
XXXXXXXX........XXXXX..................X
XXXXXX.............XX..........XXX.....X
XXXXX..................................X
XXXXXX.......X...XXXXXXXXX............XX
XXXXXXX......XX.XXXXXXXXXXX..........XXX
XXXXXXXX......X.X....XXXXXXXX........XXX
XXX..XXX.............XXXX...........XXXX
XX.....XX............X..............XXXX
XX.....XXXXXXXX.X....XX..............XXX
XX......XXXXXXXXX....XXXX............XXX
XX......XXXXXXXX.....XXXXX......XX...XXX
XX........XXXX........XX........XXXXXXXX
X.....................XX..........XXXXXX
X.....................XXX...........XXXX
X....................XXXX............XXX
X.....XXXXXXXXXXXXXXXXXX.............XXX
X......................X.............XXX
...................................XXXXX
......................XXXXXXXX....XXXXXX
XXX.XXXXXXXXXXXXXXXXXXXXXXXXX......XXXXX
XX.......X.............XXXXXX.........XX
XX.......................XXXX..........X
X.........................XXX..........X
X..........XX...............X..........X
X........XXXX.X........................X
X........XXXXXX........................X
X........XXXXXXX...........XXXX........X
X........XXXXXXXXXX.......XXXXX.......XX
XXXXX....XXXXXXXXXXXXXXXXXXXXXX......XXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...XXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
]])
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
pgimeno
Party member
Posts: 3674
Joined: Sun Oct 18, 2015 2:58 pm

Re: Help implementing game logic from fish fillets

Post by pgimeno »

Yes, but that's only the background. It's all Lua though, so you just need to do some processing to place the objects as well, which are in the same file. I didn't bother and did them by hand, and no, I won't do the rest :)

However, these levels are designed for the standard rules; if you're changing the rules to a more lax subset, these levels could be too easy. It's a bit like using the standard Sokoban levels while adding pull to the rules.

I added "!" symbols as the level exit, to allow for finishing the level in some other way than exiting through the side.
User avatar
darkfrei
Party member
Posts: 1204
Joined: Sat Feb 08, 2020 11:09 pm

Re: Help implementing game logic from fish fillets

Post by darkfrei »

The rules are not same, they are changing as well:
http://fillets.sourceforge.net/index.php#news
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
User avatar
pgimeno
Party member
Posts: 3674
Joined: Sun Oct 18, 2015 2:58 pm

Re: Help implementing game logic from fish fillets

Post by pgimeno »

darkfrei wrote: Mon Feb 14, 2022 9:05 pm The rules are not same, they are changing as well:
http://fillets.sourceforge.net/index.php#news
What news item are you talking about?

If you mean this:

"Disallowed a move, to be consistent with the original Fish Fillets. Pushing of partially supported objects is disallowed. The object has to be supported by a wall or by a fish who isn't directly under it."

it's because the original Fish Fillets had that rule, but they didn't notice it existed originally and didn't implement it. It's a very obscure case that the level designers probably didn't think about.
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

darkfrei wrote: Mon Feb 14, 2022 6:49 pm Maybe here:
http://fillets.sourceforge.net/download.php

Yes, here:
http://fillets.sourceforge.net/download ... w%20build)
fillets-ng-all-win32-1.0.1\script\start\models.lua

Code: Select all

room = addModel("item_fixed", 0, 0,
[[
.............................
.............XX.XX...........
..............X.X............
..............X.X............
.XXXX.........X.X.....XX.X.XX
XXXXX.....XXXXX.X...XXXXXXXXX
XXXXXXXXXXXXXXX.XXXXXXXXXXXXX
XXXXXXXXXXXXXXX.XXXXXXXXXXXXX
XXXXXXXXXXX.....XXXXXXXXXXXXX
XXXXXXX...........XXXXXXXXXXX
XXXX.................XXXXXXXX
XXX....................XXXXXX
XXX....................XXXXXX
XXX.....................XXXXX
XXX......................XXXX
XXX........................XX
XXX..........................
XXX..........................
XXX..........................
XXXX.........................
XXXXX.....................XXX
XXXXXXX..................XXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXX
]])
briefcase:

Code: Select all

room = addModel("item_fixed", 0, 0,
[[
.XXXX...........................................
..XXXXXX........XXXXXXX.........................
...XXXXXXXXXXXXXXXXXXXXX.....XXX.......XX.......
X....XXXXXXXXXXXXXXXXXXXXXXXXXXXXX..XXXXXXX.....
X.....XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...
X.............XXXXX......XXXX..XXXXXXXXXXXXXXX..
XX..............XX...............XXXXXXXXXXXXXXX
XXX..............................XXXXXXXXXXXXXXX
XXX...................................XXXXXXXXXX
XXXX...................................XXXXXXXXX
XXXXXXXXXXXXXXXXX.......................XXXXXXXX
XXXXXXXXXXXXXXXXX.......................XXXXXXXX
XXXXXXXXXXXXXXXXX........................XXXXXXX
XXXX.....XXXXXXXX........................XXXXXXX
XX.......XXXXXXXXXXXXXXXXXXXX.............XXXXXX
X..............XXXXXXXXXXXXX..............XXXXXX
X...............XXXXXXXXXXXX...XX.........XXXXXX
X...............XXXXXXXXXXXX...XXXX.......XXXXXX
X..........XX...XXXX...X...X...XXXX.......XXXXXX
XX...............X............XXXX........XXXXXX
XXXXX............X.............XXX........XXXXXX
XX...............X.............XX.........XXXXXX
X.........................................XXXXXX
X........................................XXXXXXX
X........................XXXX............XXXXXXX
XX.......................XXXX...........XXXXXXXX
XXXXXX...................XXXXXX........XXXXXXXXX
XX.......................XXXXXXXX....XXXXXXXXXXX
X................X.......XXXXXXXXXXXXXXXXXXXXXXX
X...............XX....XX.XXXXXXXXXXXXXXXXXXXXXXX
X............XXXXX....XXXXXXXXXXXXXXXXXXXXXXXXXX
X...............XX....XXXXXXXXXXXXXXXXXXXXXXXXXX
XX...............X.....XXXXXXXXXXXXXXXXXXX......
XX...............X........XXXXXXXXXXXXX.........
XXXX...........XXXX.............................
XXXXXXXXXXXXXXXXXXXX........................XXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
]])
cellar:

Code: Select all

room = addModel("item_fixed", 0, 0,
[[
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXX.............XXXXXX.....XXXX
XXXXXXXXX.X...............X...........XX
XXXXXXXX........XXXXX..................X
XXXXXX.............XX..........XXX.....X
XXXXX..................................X
XXXXXX.......X...XXXXXXXXX............XX
XXXXXXX......XX.XXXXXXXXXXX..........XXX
XXXXXXXX......X.X....XXXXXXXX........XXX
XXX..XXX.............XXXX...........XXXX
XX.....XX............X..............XXXX
XX.....XXXXXXXX.X....XX..............XXX
XX......XXXXXXXXX....XXXX............XXX
XX......XXXXXXXX.....XXXXX......XX...XXX
XX........XXXX........XX........XXXXXXXX
X.....................XX..........XXXXXX
X.....................XXX...........XXXX
X....................XXXX............XXX
X.....XXXXXXXXXXXXXXXXXX.............XXX
X......................X.............XXX
...................................XXXXX
......................XXXXXXXX....XXXXXX
XXX.XXXXXXXXXXXXXXXXXXXXXXXXX......XXXXX
XX.......X.............XXXXXX.........XX
XX.......................XXXX..........X
X.........................XXX..........X
X..........XX...............X..........X
X........XXXX.X........................X
X........XXXXXX........................X
X........XXXXXXX...........XXXX........X
X........XXXXXXXXXX.......XXXXX.......XX
XXXXX....XXXXXXXXXXXXXXXXXXXXXX......XXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX...XXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
]])
Oh yes, I have them since a long time, I just couldn't find where the files were. The backgrounds is all I need. Puting the objects it's a lot easier that doing the whole background from scratch so don't worry, I will do all levels.

Can we make an object that once touched set the fish free? and once the two are free start the new level?
pgimeno wrote: Mon Feb 14, 2022 9:10 pm
darkfrei wrote: Mon Feb 14, 2022 9:05 pm The rules are not same, they are changing as well:
http://fillets.sourceforge.net/index.php#news
What news item are you talking about?

If you mean this:

"Disallowed a move, to be consistent with the original Fish Fillets. Pushing of partially supported objects is disallowed. The object has to be supported by a wall or by a fish who isn't directly under it."

it's because the original Fish Fillets had that rule, but they didn't notice it existed originally and didn't implement it. It's a very obscure case that the level designers probably didn't think about.
Pgimeno is right, in the third level for example you can make the small fish pass through the small hole where the oyster and little pipe thing stands without killing it. The small fish can not support heavy objects, it should die instantly. You can also carry the axe without the need of the marmelade can so many parts the puzzle are broken and easier. There are two solutions for that, 1. Implementing the missing rule of the original game, 2. Making new levels according to the current implemented rules. As you wish, Even both things can be done, I can make game states two activate or deactivate rules for different levels.

Darkfrei, I'm doing little aesthetics changes to the drawing part of your library, at least till we have textures or tiles. Please try not to override them if you send me the code. I want to highlight wall borders and also set that the tiles are drawn with at least two colors.

Here are some of the changes I'm doing:

I'm trying to substitute my deprecated table renderer here:

Code: Select all

wborder = {
{
{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ',' ',' ',' ',' ','#','#','#','#',' ',' ',' ',' ',' ','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ',' ','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#',' ',' ',' ',' ',' ',' '},
{' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',' ',' ',' ',' ',' '},
{' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',' ',' ',' ',' ',' '},
{' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',' ',' ',' ',' '},
{' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#',' ',' '},
{' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#'},
{' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#'},
{' ',' ',' ',' ',' ','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',' ',' ',' '},
{' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ',' '},
},{  
{' ','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ','#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ',' ',' ','#','#','#',' ',' ',' ',' ',' ',' ',' ','#','#',' ',' ',' ',' ',' ',' ',' '},
{'#',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ','#','#','#','#','#','#','#',' ',' ',' ',' ',' '},
{'#',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' '},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#',' ',' ',' ',' ',' ',' ','#','#','#','#',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' '},
{'#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#'},
{'#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#'},
{'#','#','#','#',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#'},
{'#','#',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ','#','#','#','#',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#',' ',' ',' ','#','#','#','#',' ',' ',' ','#',' ',' ',' ','#',' ',' ',' ','#','#','#','#',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#'},
{'#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#'},
{'#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#'},
{'#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#'},
{'#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#'},
{'#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#'},
{'#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#',' ',' ',' ',' ','#','#',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
{'#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ',' ',' ',' '},
{'#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{'#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' '},
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ','#','#','#','#'},
{'#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#','#'},
},
}


  function loadwallborder()
        wb1 = {}
        for y, row in ipairs(wborder[nLevel]) do
            wb1[y] = {}
            for x, cell in ipairs(row) do
                wb1[y][x] = cell
            end
        end
    end

function draw_wallborders()
    for y, row in ipairs(wb1) do
        for x, cell in ipairs(row) do
            if cell ~= empty then
                
                

                 love.graphics.setColor(0.8, 0.78, 0.4)
                --love.graphics.setColor(0.5,0.5,0)
                love.graphics.rectangle('fill',(x - 1) * cellWidth, (y - 1) * cellHeight,cellSize,cellSize)
                
                love.graphics.setColor(0.6, 0.58, 0.2)
                love.graphics.print(wb1[y][x],(x - 1) * cellWidth,(y - 1) * cellHeight)
                love.graphics.setColor(1, 1, 1)
            end
        end
    end
end
with an adapted versions of yours to keep consistency. The goal is to draw a separate table to highlight contours and edges, basically with an aesthetic function, however I get errors, could you assist me to make your function work please? the file is in: game/levels/drawboders.lua
Here is the code I'm trying to implement:

Code: Select all

local level = {}

level.name = 'level-1'

-- first cell is map[1][1], top left corner
level.map = 
{	-- 0 is empty, 1 is full,
	-- 2 an higher are empty, but you can use it as placeholders
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,0}, 
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0},
    {0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0},
    {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
    {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0},
    {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0},
    {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0},
    {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1},
    {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1},
    {0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1},
    {0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
    {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0},
}


-- prepare level

-- prepare map

level.w = 0 -- map width in tiles (same as highest x)
level.h = #level.map -- map height in tiles
for y, xs in ipairs (level.map) do
	for x, value in ipairs (xs) do
		if value == 1 then
			-- now value is true
			level.map[y][x] = true
			if level.w < x then level.w = x end
		else
			-- now value is false
			level.map[y][x] = false
		end
	end
end


---------------------------------------------------------------------------------------------------
-- draw
---------------------------------------------------------------------------------------------------



function pb:load (level)
--	print (level.name)
	local width, height = love.graphics.getDimensions()
	self.map = level.map
	self.gridWidth = level.w
	self.gridHeight = level.h
	self.gridSize = math.min(width/(level.w), height/(level.h))
	print ('gridWidth: ' .. self.gridWidth, 
		'gridHeight: ' .. self.gridHeight,
		'gridSize: ' .. self.gridSize)
end

function pb:drawMap ()
	local map = self.map
	local tileSize = self.gridSize
	love.graphics.setLineWidth(2)
	
	for y, xs in ipairs (map) do
		for x, value in ipairs (xs) do
			-- value is boolean: true or false
			if value then -- map tile
				-- beware of -1
				love.graphics.setColor(0.5,0.5,0.5)
				love.graphics.rectangle ('fill', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize)
				love.graphics.setColor(0.6, 0.58, 0.2)
				love.graphics.rectangle ('fill', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize-15)
				love.graphics.setColor(0,0,0)
				
					if debugmode=="yes" then 
					--love.graphics.print("#",(x-1)*tileSize, (y-1)*tileSize) end
					love.graphics.print ((x)..' '..(y), (x-1)*tileSize, (y-1)*tileSize) end
			end
		end
	end
end

return pb
I also added a second rectangle on the tiles to have two colors, I think it's more pleasant to the eyes, at least till we have textures.
push-blocks.lua

Code: Select all

function pb:drawMap ()
	local map = self.map
	local tileSize = self.gridSize
	love.graphics.setLineWidth(2)
	
	for y, xs in ipairs (map) do
		for x, value in ipairs (xs) do
			-- value is boolean: true or false
			if value then -- map tile
				-- beware of -1
				love.graphics.setColor(0.5,0.5,0.5)
				love.graphics.rectangle ('fill', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize)
				love.graphics.setColor(0.6, 0.58, 0.2)
				love.graphics.rectangle ('fill', (x-1)*tileSize, (y-1)*tileSize, tileSize, tileSize-15)
				love.graphics.setColor(0,0,0)
				
					if debugmode=="yes" then 
					--love.graphics.print("#",(x-1)*tileSize, (y-1)*tileSize) end
					love.graphics.print ((x)..' '..(y), (x-1)*tileSize, (y-1)*tileSize) end
			end
		end
	end
end
last thing to ask, with that crt effect and the simple colors I'm feeling nostalgia, does anyone knows where to find palettes of old machines like zx spectrum or c64? just to experiment...


If anyone wants to be creative and let imagination fly here there are a few new rules implemented in the second part of the game:

https://gamefaqs.gamespot.com/pc/933186 ... faqs/59533

There are four basic material types, namely, steel bars, normal, seaweed and ice.

b. Actors
== ======
The actors come in four different varieties: Fish-like, crab-like, snails,
and turtles.

c. Other objects
== ===== =======

Starfish
--------
Collect these for bonuses.

Lasers
------
These must be avoided. If any object is placed in the path of the laser,
the laser will not go past that object.

Just something I would like to warn, that is an actual commercial game and I would avoid at all cost trying to copy any of that, I just post it to let you think about how many twist can be made to the rules, but let's keep out of trouble and make original things, I think that would be better.
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

Just in case anyone wants to help with the levels

Code: Select all

[size=50]

                                	                     



                                                       3. City in the Deep                       1. Ship Wrecks                                               
                                                     .xOXX0x'                                                                                         
                                             dKNWNK. OWNNNNNWo                                        .;:;.                                           
                                            xWNNNNNc lNNNXXXWK                            .kKWWXk.  'NWWNWW0.                                         
                                            kWNNNNNK..XWNXklc,                           .NWNNNNNd  lNNNNNNWN.                                        
                                      cdkkd. ;0NWWW0' .,:, .;okKXo.                      .KNNNNNN.  xNNNNNNKl  ;;'                                    
                                    .0WNNNNNk, ',,.      .KNNNNNNWX                .x0XXO..xNNWWN.  .d0XXKc .c0NNWNc                                  
                                    :MNNNNNNWO           oWNXXNNNWN       0       .XWNNNN0; .;,,           lNNNNNNNW;                                 
                                    .KWNNNNWX'           xkOlOXWNd.   Fish house  ,MNNNNNNWk               oWNNNNNNK.                                 
                                      ;coxx;           .'.    ..          ..       kWWNNN0x.                lOOo;...'                                 
                                  .cdl::,.            ,NNNKK0kx,       :KWWWW0,      '... .:dd'                ,lOXNWWo                               
                                 .XWNNNNWK.           dWNNNNNNWd      'WNNNNNNW:       ,oXNNNNWk              ;WNNNNNNWl                              
                                 dWNNNNNNWl           .XWNNNWWx. Start;WNNNNNNWl       KWNNNNNNM,             ,WNNNNNNN:                              
                                 ;WNNNNNWK.             ,oool.         lXkdo:;.        cWNNNNWWd               .;::oxk'                               
                                  .:......                               .,;;oxKx.      .ldddl.              .lkkdl:.                                 
                                  .:::xKXNWO.                 Briefcase ;MKO0XNNW0                          .XWNNNNNNc                                
                                  OXOOXNNNNW0                           .NKodKWWNl                          :MNNNNNNW0                                
                                  0WNNNNNNN0c                            .,';,,.                         ',. .lKNNNW0.                                
                                   .'lOOd:. .lOd.                       .lxxx,                         xWWWN0l. :lc'                                  
                                        .okKNNNNWc            Cellar   .KNNNNX,                       :WNNNNNNW:                                      
                                        :MNNNNNNXc                     .XNNKOx.                'xKXKO; .ONNNNNW;                                      
                                         xWWNNKc  c0N0c                 'cl.                  ,NNNNNNNc .NWWNk'                                       
                                          .;:' .cKNNNNWO    Library :oxkd,    .'.     .cddlcl  ONNNNNNN;                                              
                                              .WWNNNNNo .ol;       lNNNNNo .;0NNNKc  ,0NNNNNN; .WNNNWNo   Picnic Boat                                            
                                               ;KWWWN; .KNNNO.     cXNN0O, xXNNNNNN. :KNNNNX:.  ':cc;.                                                
                                                 .,,. .KNNNNNO;..,; .;:     .o0O;'.    'cc;.                                                          
                                                       .cooccoONNNNXx;                    ..      ..','                             .;:;.             
                                                               ;NNNNO  o00x.   :OXXO;   lXNNK:  cNWWWWW0 .dl;.                    ,NWWNWW0.           
                                                       Stairs   ,dkk. xNNNNN..kNNNNNN, xNNNNN0 .XNNNNNk .0NNWWO. 'lc;.    ..     .WWNNNNNWW.          
                                                               ,c:;'  xNNNNO  ;xNNNXo  ,oKNN0; ;NNNNNk .ONNNNNk .0NNWW: .KWWW0;  .kkKKNNNW0           
                                                  Boiler Room oNNNNNO  '';X;     ..            .0WWWWo cWNNNNk .KNNNNN. :NNNNNN.  .    .',            
                                                              xNNNNNl    'XNXO:   ,cc,           ....  .l0XXXl lNNNNNk .0NNNNX'  'XXkdc,'             
                                                               ;l;''    .XNNNNN: ;NNNNO'                       .d000O' :NWWWW;  .KNNNNNNWl            
                                                                 'odkKk .oNNNXo  ONNNNNd    .                            ....   .0WNNNWNo             
                                                     Reef        ONNNNNl  ...    .cddd:. ,dKWXl                                   .:cc;.              
                                 :dkkdc                          .x0KOl.  ;.          .kXNNNNNWK                                                      
                               .0WNNNNWd  cdkkd:            Wc        .cxKNNx         .WWNNNNNWK                                                      
                               ,MNNNNNNc ;NNNNNWX,                   oKXNNNNW0.        ,0WNOo;..,lc                                                   
                               .KWNNNNW. oNNNNNNWk              .okk,  .;kKc::lxxd:      ...,lOXNNWX.                                                 
                                 ':ccl;  OWNNNNWX'             'NNNNNKd,    dWNNNNWXc      dWNNNNNNWl                                                 
                             cxxl;..      ;oddo;               ;NNNXKXNW:  .MNNNNNNNM.     'K0OOkddo.                                                 
                            OWNNNNNWx                    .':c:; ;XNNNNWk    kWNNNNNMd        .',,;clo.                                                
                           .MNNNNNNNW.                  cWWNNWX; .lddl,      ;d0kc'....     ,NNNNNNNWd                                                
                            xWWNNNXo. ,:;'      .,:;'   KNNNNNNNO               .;oKNWWo  ... ;dXNNWX'                                                
                             .cook; .xNNNWNc   dWWNNWN' cNNNNNNWx              KWNNNNN0. oWWNk; 'OOl.                                                 
                                   'KNNNNNNW.  ONNNNNN0. oKXXXO:               dWNNNNX. oNNNNNNO                                                      
                                   lWNNNNNNW:  dNNNNNNN;                        ,okkk: cNNNNNNWN.                                                     
                                    ;xKXXKd.   'xKXXKd.                                ,0WWWWNd.                                                      
                                                                                         ....                                                         
									7.Dump												5. Coral Reef
	
0. Fish House								Level	Level Name:				Status
      a. How It All Started					01		start					Done
      b. Briefcase Message					02		briefcase				Done
      c. Rehearsal in Cellar				03		cellar					Done
      d. Library Flotsam					04		library					Done
      e. Plants on the Stairs				05		stairs
      f. A Mess in the Boiler Room			06		broom
      g. Under the Reef						07		reef
      h. Closed in the Closet				08		wc
   1. Ship Wrecks
      a. Drowned Submarine					09		submarine
      b. Picnic Boat						10		party1
      c. Great War							11		elk
      d. The Ship of Captain Silver			12		wreck
      e. The Last Voyage					13		viking1
      f. Altitude: Minus 9000 Feet			14		airplane
      g. Bathyscaph							15		bathyscaph
      h. Amphibious Tank					16		tank
      i. Eight Vikings in a Boat			17		viking2
      j. Return from the Party				18		party2
      k. The Gods Must Be Mad				19		gods
   2. Silver's Ship
      a. The First Mate's Cabin				45		cabin1
      b. The Winter Mess Hall				46		snowman
      c. Fire!								47		cannons
      d. Ship Kitchen						48		kitchen
      e. Second Mate's Cabin				49		cabin2
      f. Captain's Cabin					50		captain
      g. Silver's Hideout					51		map
   3. City in the Deep						
      a. House With an Elevator				20		elevator1
      b. Welcome to Our City				21		city
      c. Independence Day					22		ufo
      d. The Columns						23		columns
      e. Uneven Pavement					24		pavement
      f. Mr. Cheop's House					25		pyramid
      g. A Bit of Music						26		music
      h. Crab Freak Show					27		crabshow
      i. Another Elevator					28		elevator2
      j. And How It Was						29		atlantis
   4. UFO
      a. Power Plant						52		reactor
      b. Strange Forces						53		magnet
      c. Brm... Brm...						54		engine
      d. Nothing But Steel					55		steel
      e. Guarded Corridor					56		corridor
      f. Biological Experiments				57		experiments
      g. The Real Propulsion				58		propulsion
   5. Coral Reef
      a. First Bizarre Things				30		corals
      b. Labyrinth							31		labyrinth
      c. Imprisoned							32		imprisoned
      d. Closed Society						33		society
      e. Sleeping Creatures					34		creatures
      f. Cancan Crabs						35		cancan
      g. One More Pearl; Please!			36		pearls
      h. Telepathic Devil					37		turtle
   6. Treasure Cave
      a. Aztec Art Hall						59		aztec
      b. Shiny Cave-In						60		gems
      c. Giant's Chest						61		chest
      d. The Hall of Ali-Baba				62		alibaba
      e. The Deepest Cave					63		cave
      f. What Would King Arthur Say?		64		grail
   7. Dump
      a. The Deep Server					38		computer
      b. Almost No Wall						39		noground
      c. Plumbman's Refute					40		bathroom
      d. Adventure With Pink Duckie			41		duckie
      e. Shredded Stickman					42		puzzle
      f. Real Chaos							43		dump
      g. Outraged Greenpeace				44		barrel
   8. Secret Computer 
      a. Tetris								65		tetris
      b. Emulator							66		emulator
      c. Garden of War						67		warcraft
      d. Favorites							68		windoze
      e. A Hardware Problem					69		hardware
      f. Read Only							70		floppy

If anyone decides to help please inform, it can happens that some people work on the same levels and that would be a waste of resources and time. Thanks!

Oh I forgot, the only thing that needs to be done with the level is writing the objects (blocks) and agents with their position and label the objects with heave=true or false depending if they are heavy or not.

This is a small template:

Code: Select all

level.blocks = 
{
	{name = 'chair1',
	heavy = false,
	x = 8,
	y = 18,
	form = 
		{
			{1,0,0,0},
			{1,0,0,0},
			{1,1,1,1},
			{1,0,0,1},
			{1,0,0,1},
		},
	},
}
level.agents = 
{
	{name = 'fish-3x1',
	fish = true,
	heavy = false,
	x = 13,
	y = 15,
	form = 
		{
			{1,1,1},
		},
	},
	
	
	{name = 'fish-4x2',
	fish = true,
	heavy = true,
	x = 20,
	y = 15,
	form = 
		{
			{1,1,1,1},
			{1,1,1,1},
		},
	},
}
Update: Level 4 is done
level4.png
level4.png (42.88 KiB) Viewed 5351 times
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

don't blame me if something fishy happens to your mobile...
touch2.png
touch2.png (86.11 KiB) Viewed 5316 times
Last edited by glitchapp on Tue Feb 15, 2022 12:13 pm, edited 1 time in total.
User avatar
darkfrei
Party member
Posts: 1204
Joined: Sat Feb 08, 2020 11:09 pm

Re: Help implementing game logic from fish fillets

Post by darkfrei »

glitchapp wrote: Tue Feb 15, 2022 3:23 am last thing to ask, with that crt effect and the simple colors I'm feeling nostalgia, does anyone knows where to find palettes of old machines like zx spectrum or c64?
Old 8-bit consoles have 8 bits for all colors:
3 bits for red, 3 bits for green and 2 bits for blue (or 3+2+3 or 2+3+3).

So the colors:

Code: Select all

r = math.floor((r+1)/32+0.5)*32-1 -- 255/32 is 8; keep 8 colors of red
g = math.floor((g+1)/32+0.5)*32-1 -- 255/32 is 8; keep 8 colors of green
b = math.floor((b+1)/64+0.5)*64-1 -- 255/64 is 4; keep 4 colors of blue
See also: https://www.davenicholson.ca/2018/06/co ... codes.html
:awesome: in Lua we Löve
:awesome: Platformer Guide
:awesome: freebies
glitchapp
Party member
Posts: 264
Joined: Tue Oct 05, 2021 10:34 am
Contact:

Re: Help implementing game logic from fish fillets

Post by glitchapp »

darkfrei wrote: Tue Feb 15, 2022 11:29 am
glitchapp wrote: Tue Feb 15, 2022 3:23 am last thing to ask, with that crt effect and the simple colors I'm feeling nostalgia, does anyone knows where to find palettes of old machines like zx spectrum or c64?
Old 8-bit consoles have 8 bits for all colors:
3 bits for red, 3 bits for green and 2 bits for blue (or 3+2+3 or 2+3+3).

So the colors:

Code: Select all

r = math.floor((r+1)/32+0.5)*32-1 -- 255/32 is 8; keep 8 colors of red
g = math.floor((g+1)/32+0.5)*32-1 -- 255/32 is 8; keep 8 colors of green
b = math.floor((b+1)/64+0.5)*64-1 -- 255/64 is 4; keep 4 colors of blue
See also: https://www.davenicholson.ca/2018/06/co ... codes.html
Cool! I will use that, there's so much to do that I need to make a list.

I'm busy with the touch controls and the dialogs. I will put everything on a queue because I don't know where to start.

I will be uploading the code to github, if anyone wants to keep track of the game or contribute please check and follow https://github.com/glitchapp/luasok.

A better way to keep updated is just to clone and pull the repository.

That's all by now!
Post Reply

Who is online

Users browsing this forum: Ahrefs [Bot] and 3 guests