Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
with
244 additions
and 74 deletions.
- +8 −8 collab_2/gfx/gfx0
- +32 −32 collab_2/gfx/gfx1
- +2 −1 collab_2/lua/05.lua
- +170 −1 collab_2/lua/06.lua
- +16 −16 collab_2/map/map0
- +16 −16 collab_2/map/map1
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -1,32 +1,32 @@ | ||
| 00044400000000005555555555555555000000066600000000000000660000000000000000000000000000000000000000000000888488846767676767676767 | ||
| 004ffff0000000005565555555555655000006677766000000000001dd6600000000000000000000000000000000000000011000444444447676767676333376 | ||
| 004f3f3000088000560666666666606500066777777766000000001666dd66000000000000000000000000000000000000155100848884886767676767333367 | ||
| 004ffff00088e800556000000000065506677777777777660000001dd666dd610000000000000000000000000000000001555510444444447676767676333376 | ||
| 000fff000888888055600000000006551d77777777777771100001666dd666110000000000000000000000000000000001555510888488846767676767476767 | ||
| 0fddd0000d888880556000000000065516dd77777777711d100001dd666dd6110000000000000000000000000000000000155100444444447676767676467676 | ||
| 00dddf0000d8880055600000000006551666dd7777711ddd10001666dd6661d10000000000000000000000000000000000011000848884886767676767476767 | ||
| 00404000000dd0005560000000000655166666dd711ddddd10001dd666dd61d10000000000000000000000000000000000000000444444447676767676767676 | ||
| 55600000000006555560000000000655166666661ddddddd1001666dd6661dd10000000000000000000000000000000000000000000000000000000000000000 | ||
| 55600000000006555560000000000655166666661ddddddd1001dd666dd61dd10000000000000000000000000000000000000000000000000000000000000000 | ||
| 55600000000006555560000000000655166666661ddddddd101666dd6661ddd10000000000000000000000000000000000000000000000000000000000000000 | ||
| 55600000000006555560000000000655166666661ddddddd101dd666dd61ddd10000000000000000000000000000000000000000000000000000000000000000 | ||
| 55600000000006555560000000000655166666661dddddd111666dd6661dddd10000000000000000000000000000000000000000000000000000000000000000 | ||
| 55600000000006555606666666666065011666661dddd1100116666dd61dd1100000000000000000000000000000000000000000000000000000000000000000 | ||
| 55600000000006555565555555555655000116661dd110000001166661d110000000000000000000000000000000000000000000000000000000000000000000 | ||
| 55600000000006555555555555555555000001161110000000000116611000000000000000000000000000000000000000000000000000000000000000000000 | ||
| 00000000555555555555555555555555000000011000000000000001100000000000000000000000000000000000000000000000000000000000000000000000 | ||
| 00000000555555555555555500000000000000dd0000000090000900000000000000000000000000000000000000000000000000000000000000000000000000 | ||
| 000000006666666655555555000000000000dd55dd0000097100999000ddd0000000000000000000000000000000000000000000000000000000000000000000 | ||
| 0000000000000000555555550000000000dd555555dd0001778079780d111d000000000000000000000000000000000000000000000000000000000000000000 | ||
| 00000000000000005555555500000000dd5555555555dd0777002770d16661d00000000000000000000000000000000000000000000000000000000000000000 | ||
| 6666666600000000555555550000000055555555555555027e2222201666661d0000000000000000000000000000000000000000000000000000000000000000 | ||
| 55555555000000005555555555555555dd5555555555dde22e22e22e1666661d0000000000000000000000000000000000000000000000000000000000000000 | ||
| 5555555500000000555555555555555500dd555555dd00e22e22e22e166666610000000000000000000000000000000000000000000000000000000000000000 | ||
| 000000000000000000000000000000000000dd55dd0000eccc22ccce166666610000000000000000000000000000000000000000000000000000000000000000 | ||
| 00000000000000000000000000000000000000dd000000ec0c72c0c7166666d10000000000000000000000000000000000000000000000000000000000000000 | ||
| 00000000000000000000000000000000888888888888887c0c07c0c01666ddd10000000000000000000000000000000000000000000000000000000000000000 | ||
| 00000000000000000000000000000000888888888888880c0c00c0c016ddddd10000000000000000000000000000000000000000000000000000000000000000 | ||
| 00000000000000000000000000000000888888888888880c0c00c0c01dddddd10000000000000000000000000000000000000000000000000000000000000000 | ||
| 00000000000000000000000000000000888888888888880c022022c0011dddd10000000000000000000000000000000000000000000000000000000000000000 | ||
| 0000000000000000000000000000000088888888888888022000002200011dd10000000000000000000000000000000000000000000000000000000000000000 | ||
| 00000000000000000000000000000000888888888888880000000000000001110000000000000000000000000000000000000000000000000000000000000000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -1 +1,2 @@ | ||
| add(games,{name="tbd",author="tbd",_update = function() win() end}) -- game 5 | ||
|
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @@ -1 +1,170 @@ | ||
| add(games, { | ||
| name = "pikoban", | ||
| author = "iko", | ||
|
|
||
| --------------------------------------- | ||
| -------------------------------- init | ||
| _init = function(self) | ||
|
|
||
| ---------------------------- | ||
| --------------------- vars | ||
| cubes = {} | ||
| playerfacing, curlevel = 101, 0 | ||
|
|
||
| ---------------------------------------------- | ||
| -------------------------- internal functions | ||
|
|
||
| getspritecoords, drawthing, loadlevel = | ||
|
|
||
| -------------------------------- | ||
| function(i)--getspritecoords | ||
|
|
||
| if i==101 or i==102 then --player | ||
| return 46,49,5,17 | ||
| elseif i>102 then --player | ||
| return 51,49,5,17 | ||
| elseif i==5 then --floor | ||
| return 32,49,14,9 | ||
| elseif i<4 then --cube | ||
| return 32,32,17,17 | ||
| end | ||
| --elseif i==4 then --ramps | ||
| return 49,32,16,18 | ||
| --end | ||
|
|
||
| end, | ||
|
|
||
| -------------------------------- | ||
| function(x,y,n)--drawthing | ||
|
|
||
| --xy to iso | ||
| local finalx, finaly = 56 + 8*x - 8*y, 24 + 4*x + 4*y | ||
| local sx, sy, sw, sh = getspritecoords(n) | ||
|
|
||
| finaly -= sh | ||
|
|
||
| if n<4 then finalx -=1 finaly -=1 end | ||
|
|
||
| if n > 100 then | ||
| finalx += 5 | ||
| if playerh then finaly -= 10 end | ||
| end --correct player coords | ||
|
|
||
| if n == 2 then | ||
| pal(7,15) | ||
| pal(6,9) | ||
| pal(13,4) | ||
| end | ||
|
|
||
| --draw | ||
| sspr(sx,sy,sw,sh,finalx,finaly,sw,sh, | ||
| n == 102 or n == 103)--flipx | ||
|
|
||
| pal() | ||
|
|
||
| --doorway to exit | ||
| if n==3 then | ||
| sspr(56,49,8,17,finalx+8,finaly-12) | ||
| end | ||
| end, | ||
|
|
||
| -------------------------------- | ||
| function(lvl) --loadlevel | ||
|
|
||
| playerx, playery, playerh, curlevel = 8, 8, false, lvl | ||
|
|
||
| for x=1, 8 do | ||
| cubes[x] = {} | ||
| for y=1, 8 do | ||
| cubes[x][y] = mget((lvl%4)*8+x+31,flr(lvl/4)*8+y-1) | ||
| end | ||
| end | ||
| end | ||
|
|
||
| --menuitem(1,"restart level",function() loadlevel(curlevel) end) | ||
|
|
||
| loadlevel(0) | ||
|
|
||
| end, | ||
| ---------------------------------------------- | ||
| -------------------------------- draw | ||
| _draw = function() | ||
|
|
||
| ---------------------------------------------- | ||
| -------------------------------- update | ||
| --_update = function() | ||
|
|
||
| local deltax, deltay = 0, 0 | ||
|
|
||
| if btnp "0" then deltax -= 1 playerfacing = 103 | ||
| elseif btnp "1" then deltax += 1 playerfacing = 101 | ||
| elseif btnp "2" then deltay -= 1 playerfacing = 104 | ||
| elseif btnp "3" then deltay += 1 playerfacing = 102 | ||
| elseif btnp "5" then loadlevel(curlevel) end --restart button | ||
|
|
||
| local intendedx, intendedy, moveplayerintended = | ||
| mid(1,playerx+deltax,8), | ||
| mid(1,playery+deltay,8), | ||
| false | ||
|
|
||
| local intendedcubeindex = cubes[intendedx][intendedy] | ||
|
|
||
| --collisions | ||
|
|
||
| if intendedcubeindex==4 and deltay!=0 then --ramp y (both levels) | ||
|
|
||
| playery, playerh = intendedy+deltay, not playerh | ||
|
|
||
| elseif playerh then --level above | ||
|
|
||
| moveplayerintended = intendedcubeindex<3 | ||
|
|
||
| --level up! | ||
| if intendedcubeindex==3 then | ||
| loadlevel(curlevel+1) | ||
| end | ||
|
|
||
| else --level ground | ||
|
|
||
| if intendedcubeindex==5 then --walk into nothing | ||
|
|
||
| moveplayerintended = true | ||
|
|
||
| elseif intendedcubeindex==2 then --walk into movecube | ||
|
|
||
| local intplusx, intplusy = intendedx+deltax, intendedy+deltay | ||
|
|
||
| if intplusx < 9 and intplusx > 0 and | ||
| intplusy < 9 and intplusy > 0 and | ||
| cubes[intplusx][intplusy] == 5 then | ||
|
|
||
| cubes[intplusx][intplusy] = 2 | ||
| cubes[intendedx][intendedy] = 5 | ||
| moveplayerintended = true | ||
|
|
||
| end | ||
| end | ||
| end | ||
|
|
||
| if moveplayerintended then | ||
| playerx, playery = intendedx, intendedy | ||
| end | ||
|
|
||
| --end,--update | ||
|
|
||
| cls() | ||
|
|
||
| print(curlevel<15 and "picoban level "..curlevel or "!congratulations the end!",13,0,13) | ||
|
|
||
| for x=1,8 do for y=1,8 do | ||
| drawthing(x,y,cubes[x][y]) | ||
|
|
||
| if x==playerx and y==playery then | ||
| drawthing(playerx,playery,playerfacing) | ||
| end | ||
|
|
||
| end end --end x,y | ||
|
|
||
| end, | ||
| } | ||
| ) |
Oops, something went wrong.