diff --git a/data/balloon.lua b/data/balloon.lua new file mode 100644 index 0000000..7a2f012 --- /dev/null +++ b/data/balloon.lua @@ -0,0 +1,48 @@ +balloon={ + text=nil, + height=0, + tail={pos=0,under=true}, + pos=0, + cursor={x=0,y=0}, + old_update=nil, + + show=function(txt,height,tail) + balloon.text=txt + balloon.height=height + balloon.tail=tail + balloon.pos=0 + balloon.cursor={x=0,y=0} + balloon.old_update=update + update=balloon.update + + if balloon.tail.under then + rectfill(9,height-50,153,height-15,5) + rectfill(8,height-51,152,height-16,8) + rect(8,height-51,152,height-16,6) + + local pos=balloon.tail.pos + if pos<80 then + for i=0,4 do rect(pos,height-16+(4-i),pos+i,height-16+(4-i),8) end + line(pos-1,height-15,pos-1,height-10,6) + line(pos+4,height-15,pos-1,height-10,6) + else + for i=0,4 do rect(pos+i,height-16+i,pos+4,height-16+i,8) end + line(pos+5,height-15,pos+5,height-10,6) + line(pos,height-15,pos+5,height-10,6) + end + end + + text("12345678901234567890123456789012\n3",16,height-44, 2) + text("UNO DOS TRES",16,height-35, 2) + text("UNO DOS TRES",16,height-26, 2) + end, + + draw=function() + if ballon.text then + + end + end, + + update=function() + end +} diff --git a/data/game.ini b/data/game.ini index 1c6440f..4e46ec7 100644 --- a/data/game.ini +++ b/data/game.ini @@ -3,4 +3,4 @@ config=ja2 width=160 height=144 zoom=5 -files=actors.lua,game.lua,mapa.lua,editor.lua,textbox.lua,menu.lua,main.lua +files=balloon.lua,actors.lua,game.lua,mapa.lua,editor.lua,textbox.lua,menu.lua,main.lua diff --git a/data/game.lua b/data/game.lua index 4d05734..79982f3 100644 --- a/data/game.lua +++ b/data/game.lua @@ -23,6 +23,8 @@ game={ actors.draw() camera(0,0) + balloon.show("HOLA", hero.y*8, {pos=90,under=true}) + if hero and not hero.path and hero.dx+hero.dy==0 then if btn(KEY_DOWN) then hero.path={pos=0,route='d'}