[WIP] Dialeg

This commit is contained in:
2026-04-20 22:08:02 +02:00
parent a4f989eb02
commit e152df913c
3 changed files with 47 additions and 5 deletions

40
data/dialeg.lua Normal file
View File

@@ -0,0 +1,40 @@
function dialog.new( _text, _actor )
return {
actor = _actor,
text = _text,
time = 60,
}
end
function dialeg:draw( )
local w = 50
local h = 20
local x = 0
local y = 0
y = actor.y-20
if actor.flip then
x = actor.x-w
else
x = actor.x+actor.w
end
x, y = viewp:screen_coords( x, y )
draw.rrectf(x, y, w, h, 5, 2)
if actor.flip then
draw.line(x+w, y+h-1+5, x+w-20, y+h-1, 2)
draw.line(x+w, y+h-1+5, x+w-18, y+h-1, 2)
draw.line(x+w, y+h-1+5, x+w-14, y+h-1, 2)
draw.line(x+w, y+h-1+5, x+w-12, y+h-1, 2)
else
draw.line(x, y+h-1+5, x+20, y+h-1, 2)
draw.line(x, y+h-1+5, x+18, y+h-1, 2)
draw.line(x, y+h-1+5, x+14, y+h-1, 2)
draw.line(x, y+h-1+5, x+12, y+h-1, 2)
end
local font_curr = font.current()
font.current(font_default)
draw.text(text, x+5,y+7, 16)
font.current(font_curr)
end

View File

@@ -20,6 +20,7 @@ require "bar_meter"
require "stage1"
require "remote_view"
require "dialeg"
local DEBUG = false
@@ -272,8 +273,8 @@ function update_game()
score.draw()
if DEBUG then
special_keys()
if DEBUG then
debug_info()
end
end
@@ -381,9 +382,10 @@ function special_keys()
print_analisis()
end
if key.press(key.D) then
boss.x_old = boss.x
boss.x = boss.x+1
print_analisis()
-- boss.x_old = boss.x
-- boss.x = boss.x+1
-- print_analisis()
dialeg_draw( "Hola mundo!", abad )
end
if key.press(key.W) then
boss.y_old = boss.y

View File

@@ -90,7 +90,7 @@ function mini.init()
surf.cls(16)
local a = 1 | 2
print(a)
flow:executar("logo")
flow:executar("game")
end
function mini.update()