Skip to content
Permalink
Browse files
Merge pull request #2 from fweez/master
Merge zapp-alike and Super Forum Poster, by @adam_sporka and @fweez
  • Loading branch information
josefnpat committed Sep 29, 2016
2 parents 248c46f + ceb2976 commit 9acac709df8e2e58b36d0fcbc36bf8eec7cb9b11
Showing with 291 additions and 58 deletions.
  1. +12 −12 collab_2/gfx/gfx0
  2. +24 −24 collab_2/gfx/gfx1
  3. +103 −1 collab_2/lua/03.lua
  4. +87 −1 collab_2/lua/04.lua
  5. +1 −1 collab_2/lua/05.lua
  6. +16 −16 collab_2/map/map0
  7. +3 −3 collab_2/sfx/sfx12
  8. +45 −0 graphicstool.py
@@ -1,15 +1,15 @@
11111111050000502222222233333333000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
1222222155555555222222223333333302222222222222200dddddddddddddd00000000000000000000000000000000000000000000000000000000000000000
1211112105c00c5022e22e2233b33b3302000000000000200d000000000000d00000000000000000000000000000000000000000000000000000000000000000
38888883050cc050222ee222333bb33308888888888888800cccccccccccccc00000000000000000000000000000000000000000000000000000000000000000
82828288050cc050222ee222333bb3338882828228282888ccc1c1c11c1c1ccc0000000000000000000000000000000000000000000000000000000000000000
8282828805c00c5022e22e2233b33b338882828228282888ccc1c1c11c1c1ccc0000000000000000000000000000000000000000000000000000000000000000
56888865555555552222222233333333568888888888886565cccccccccccc560000000000000000000000000000000000000000000000000000000000000000
56555565050000502222222233333333560000000000006565000000000000560000000000000000000000000000000000000000000000000000000000000000
44444444555555556666666677777777333366555555555555663131333333330000000000000000000000000000000000000000000000000000000000000000
44444444555555556666666677777777333665555555555555566313331313330000000000000000000000000000000000000000000000000000000000000000
44944944556556556676676677677677336655555555555555556633333133330000000000000000000000000000000000000000000000000000000000000000
44499444555665556667766677766777366555555555555555555663333333330000000000000000000000000000000000000000000000000000000000000000
1111111105000050ff00800011111111000000000000000000000000000000000000000000000000000000000000000088800000770000000000000000000000
1222222155555555dd0888001ccdd99102222222222222200dddddddddddddd00000000000000000000000000000000088800000777000000000000000000000
1211112105c00c50c00080ff1cc1191102000000000000200d000000000000d00000000000000000000000000000000088000000777000000000000000000000
38888883050cc050cc0000ff1c11911108888888888888800cccccccccccccc00000000000000000000000000000000000000000000000000000000000000000
82828288050cc050c00000dd111911c18882828228282888ccc1c1c11c1c1ccc0000000000000000000000000000000000000000000000000000000000000000
8282828805c00c50000ff00011911cc18882828228282888ccc1c1c11c1c1ccc0000000000000000000000000000000000000000000000000000000000000000
5688886555555555000ff000199ddcc1568888888888886565cccccccccccc560000000000000000000000000000000000000000000000000000000000000000
5655556505000050f00ee00b11111111560000000000006565000000000000560000000000000000000000000000000000000000000000000000000000000000
44444444555555556666666677777777333366555555555555663131333333330000000000000000000000000000000000000000655500000000000000000000
4444444455555555666666667777777733366555555555555556631333131333000000000000000000000000000000000a000000666600000200000000000000
44944944556556556676676677677677336655555555555555556633333133330000000000000000000000000000000000000000556500000000000000000000
44499444555665556667766677766777366555555555555555555663333333330000000000000000000000000000000000000000666600000000000000000000
44499444555665556667766677766777665555555555555555555566333331310000000000000000000000000000000000000000000000000000000000000000
44944944556556556676676677677677655555555555555555555556333333130000000000000000000000000000000000000000000000000000000000000000
44444444555555556666666677777777555555555555555555555555333333330000000000000000000000000000000000000000000000000000000000000000
@@ -1,27 +1,27 @@
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000888488846767676767676767
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000444444447676767676333376
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000155100848884886767676767333367
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001555510444444447676767676333376
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001555510888488846767676767476767
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000155100444444447676767676467676
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000011000848884886767676767476767
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000444444447676767676767676
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00044400000000005555555555555555000000000000000000000000000000000000000000000000000000000000000000000000888488846767676767676767
004ffff0000000005565555555555655000000000000000000000000000000000000000000000000000000000000000000011000444444447676767676333376
004f3f30000880005606666666666065000000000000000000000000000000000000000000000000000000000000000000155100848884886767676767333367
004ffff00088e8005560000000000655000000000000000000000000000000000000000000000000000000000000000001555510444444447676767676333376
000fff00088888805560000000000655000000000000000000000000000000000000000000000000000000000000000001555510888488846767676767476767
0fddd0000d8888805560000000000655000000000000000000000000000000000000000000000000000000000000000000155100444444447676767676467676
00dddf0000d888005560000000000655000000000000000000000000000000000000000000000000000000000000000000011000848884886767676767476767
00404000000dd0005560000000000655000000000000000000000000000000000000000000000000000000000000000000000000444444447676767676767676
55600000000006555560000000000655000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55600000000006555560000000000655000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55600000000006555560000000000655000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55600000000006555560000000000655000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55600000000006555560000000000655000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55600000000006555606666666666065000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55600000000006555565555555555655000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55600000000006555555555555555555000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000555555555555555555555555000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000555555555555555500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000666666665555555500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000005555555500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000005555555500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
66666666000000005555555500000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55555555000000005555555555555555000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
55555555000000005555555555555555000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
@@ -1 +1,103 @@
add(games,{name="tbd",author="tbd",_update = function() win() end}) -- game 3
add(games,{
name="super forum poster 2 turbo dx edition",
author="@fweez",
_update = function()
cls()
map(16,0,0,0,16,16)
color"6"
cursor(0,1)
if not state then
print"super forum poster 2 turbo dx"
if (btnp"4") state = 0
else
print("@"..player.name.." score:"..score.." time:"..timer)
end
if state == 0 then
if (btn"0") player.x -= 1.5
if (btn"1") player.x += 1.5
if (btn"2") player.y -= 1.5
if (btn"3") player.y += 1.5

timer -= 1
if (timer == 0) state = 1
end

local yoff = 33
for a in all(actors) do
if state == 0 then
a.x = mid(8, a.x+a.vx, 122)
if (a.x <= 8 or a.x >= 122) a.vx *= -1
a.y = mid(42, a.y + (a.vy or 0), 116)
end
local s = 64
if a.color then
s = 65
if (a.y >= 116 or a.y <= 42) a.vy *= -1
if a.y <= 42 then
del(actors, a)
add(actors, a)
elseif a.vy > 0 then
for o in all(actors) do
if not o.color and abs(o.y-a.y-7) < 2 and abs(o.x-a.x) <= 6 then
a.name = o.name
a.vy = -1
break
end
end
end
print("thread:"..a.topic.." lp: @"..a.name, 4, yoff, a.color)
if (a.name == player.name and state == 0) score += 1
pal(8, a.color)
yoff -= 6
elseif a == player then
pal(13,14)
end
spr(s, a.x-4, a.y)
pal()
end

cursor(4, 44)
if (state == 1) print"game over"
if not state then
print"dominate the forum! z to start"
print" arrows move. bounce threads,"
print"and dominate the conversation!"
end
end,
_init = function(self)
actors = {}
local function rndchar(l)
local a = flr(rnd(#l))+1
return sub(l, a, a)
end
local function rndactor(p, y)
if (p) y = 116-rnd(60-p)
local alpha = "abcdefghijklmnopqrstuvwxyz"
local a = {
x=8+rnd(112),
y=y,
vx=1 - rnd(2),
name=rndchar(alpha)..rndchar(alpha)..flr(rnd(1000))
}
add(actors, a)
return a
end
for i=1,20 do
rndactor(i*2)
end
local wide = "Œ”…‰‘‚†ŠŽ’–ƒ‡‹“—"
for i=0,4 do
local t = rndactor(nil, 127)
t.vy = -1
t.topic = rndchar(wide)..rndchar(wide)
t.color = 8+i
end
player = rndactor(nil, 64)
player.x = 64
player.vx = 0
score = 0
timer = 1800
state = nil
end,
})

@@ -1 +1,87 @@
add(games,{name="tbd",author="tbd",_update = function() win() end}) -- game 4
add(games, {
name="zapp-alike",
author="@adam_sporka",

_init=function(self)
cx,cy,matrix,mask,score,t,started_at,pl=16,16,{},{},0,120,time(),true
for a=0,1023 do
matrix[a]=flr(rnd(2))+12
end
self:clear_mask()
end,

idx=function(x,y)
return x+y*32
end,

clear_mask=function()
for a=0,1023 do mask[a]=false end
lx,ly=-1,-1
end,

toggle=function(self)
i=self.idx(cx,cy)
mask[i],lx,ly=not mask[i],cx,cy
end,

match=function(self)
dx,dy=cx-lx,cy-ly
if (lx<0) return
success,count=1,0
for x=2,29 do
for y=2,29 do
tx,ty=x+dx,y+dy
if (mask[self.idx(x,y)]) then
count+=1
if (mask[self.idx(tx,ty)]) return
if (matrix[self.idx(tx,ty)]!=matrix[self.idx(x,y)]) success=0
end
end
end
score+=success*count^2
sfx(13-success)
for a=0,1023 do
if (mask[a] or mask[a-dy*32-dx]) matrix[a]=29+success
end
self.clear_mask()
end,

_update=function(self)
t=flr(120-time()+started_at)
if t<0 then
if (pl) sfx(14)
pl=false
return
end
if (btnp(0)) cx-=1
if (btnp(1)) cx+=1
if (btnp(2)) cy-=1
if (btnp(3)) cy+=1
cx,cy=(cx-2)%28+2,(cy-2)%28+2
if (btnp(4)) self:toggle()
if (btnp(5)) self:match()
end,

draw_box=function(x,y,c)
rect(x*4-1,y*4-1,x*4+3,y*4+3,c)
end,

_draw=function(self)
cls()
for x=2,29 do
for y=2,29 do
if mask[self.idx(x,y)] then self.draw_box(x,y,3) end
spr(matrix[self.idx(x,y)],x*4,y*4)
end
end
box_color=12
if (mask[self.idx(cx,cy)]) box_color=11
self.draw_box(cx,cy,box_color)
spr(28,lx*4,ly*4)
print("score "..score,8,121,7)
s="game over"
if (t>=0) s="time "..t
print(s,84,121)
end
})

@@ -1 +1 @@
add(games,{name="tbd",author="tbd",_update = function() win() end}) -- game 5
add(games,{name="tbd",author="tbd",_update = function() win() end}) -- game 3

0 comments on commit 9acac70

Please sign in to comment.