From 639d2e98ad4c6fc9b68ca9d7e010c9d2ba57be87 Mon Sep 17 00:00:00 2001 From: JailGamer Date: Sat, 28 Mar 2026 02:40:08 +0100 Subject: [PATCH] Jailgames logo --- data/X2_font.fnt | 130 ++++++++++++++++++++++++++++++++++++++++++++++ data/X2_font.gif | Bin 0 -> 1260 bytes data/intro.lua | 30 ++++------- data/logo.lua | 131 +++++++++++++++++++++++++++++++++++++++++++++++ data/main.lua | 69 ++++++++++++++++++++----- 5 files changed, 327 insertions(+), 33 deletions(-) create mode 100644 data/X2_font.fnt create mode 100644 data/X2_font.gif create mode 100644 data/logo.lua diff --git a/data/X2_font.fnt b/data/X2_font.fnt new file mode 100644 index 0000000..57484a3 --- /dev/null +++ b/data/X2_font.fnt @@ -0,0 +1,130 @@ +bitmap=X2_font.gif +32: 0 0 6 10 0 0 # +33: 8 0 6 10 0 0 # ! +34: 16 0 6 10 0 0 # " +35: 24 0 6 10 0 0 # # +36: 32 0 6 10 0 0 # $ +37: 40 0 6 10 0 0 # % +38: 48 0 6 10 0 0 # & +39: 56 0 6 10 0 0 # ' +40: 64 0 6 10 0 0 # ( +41: 72 0 6 10 0 0 # ) +42: 80 0 6 10 0 0 # * +43: 88 0 6 10 0 0 # + +44: 96 0 6 10 0 0 # , +45: 104 0 6 10 0 0 # - +46: 112 0 6 10 0 0 # . +47: 120 0 6 10 0 0 # / + +48: 0 12 6 10 0 0 # 0 +49: 8 12 6 10 0 0 # 1 +50: 16 12 6 10 0 0 # 2 +51: 24 12 6 10 0 0 # 3 +52: 32 12 6 10 0 0 # 4 +53: 40 12 6 10 0 0 # 5 +54: 48 12 6 10 0 0 # 6 +55: 56 12 6 10 0 0 # 7 +56: 64 12 6 10 0 0 # 8 +57: 72 12 6 10 0 0 # 9 +58: 80 12 6 10 0 0 # : +59: 88 12 6 10 0 0 # ; +60: 96 12 6 10 0 0 # < +61: 104 12 6 10 0 0 # = +62: 112 12 6 10 0 0 # > +63: 120 12 6 10 0 0 # ? + +64: 0 24 6 10 0 0 # @ +65: 8 24 6 10 0 0 # A +66: 16 24 6 10 0 0 # B +67: 24 24 6 10 0 0 # C +68: 32 24 6 10 0 0 # D +69: 40 24 6 10 0 0 # E +70: 48 24 6 10 0 0 # F +71: 56 24 6 10 0 0 # G +72: 64 24 6 10 0 0 # H +73: 72 24 6 10 0 0 # I +74: 80 24 6 10 0 0 # J +75: 88 24 6 10 0 0 # K +76: 96 24 6 10 0 0 # L +77: 103 24 7 10 0 0 # M +78: 112 24 6 10 0 0 # N +79: 120 24 6 10 0 0 # O + +80: 0 36 6 10 0 0 # P +81: 8 36 6 10 0 0 # Q +82: 16 36 6 10 0 0 # R +83: 24 36 6 10 0 0 # S +84: 32 36 6 10 0 0 # T +85: 40 36 6 10 0 0 # U +86: 48 36 6 10 0 0 # V +87: 55 36 8 10 0 0 # W +88: 64 36 6 10 0 0 # X +89: 72 36 6 10 0 0 # Y +90: 80 36 6 10 0 0 # Z +91: 88 36 6 10 0 0 # [ +92: 96 36 6 10 0 0 # \ +93: 104 36 6 10 0 0 # ] +94: 112 36 6 10 0 0 # ^ +95: 120 36 6 10 0 0 # _ + +96: 0 48 6 10 0 0 # ` +97: 8 48 6 10 0 0 # a +98: 16 48 6 10 0 0 # b +99: 24 48 6 10 0 0 # c +100: 32 48 6 10 0 0 # d +101: 40 48 6 10 0 0 # e +102: 48 48 6 10 0 0 # f +103: 56 48 6 10 0 0 # g +104: 64 48 6 10 0 0 # h +105: 72 48 6 10 0 0 # i +106: 80 48 6 10 0 0 # j +107: 88 48 6 10 0 0 # k +108: 96 48 6 10 0 0 # l +109: 103 48 7 10 0 0 # m +110: 112 48 6 10 0 0 # n +111: 120 48 6 10 0 0 # o + +112: 0 60 6 10 0 0 # p +113: 8 60 6 10 0 0 # q +114: 16 60 6 10 0 0 # r +115: 24 60 6 10 0 0 # s +116: 32 60 6 10 0 0 # t +117: 40 60 6 10 0 0 # u +118: 48 60 6 10 0 0 # v +119: 55 60 8 10 0 0 # w +120: 64 60 6 10 0 0 # x +121: 72 60 6 10 0 0 # y +122: 80 60 6 10 0 0 # z +123: 88 60 6 10 0 0 # { +124: 96 60 6 10 0 0 # | +125: 104 60 6 10 0 0 # } +126: 112 60 6 10 0 0 # ~ +127: 120 60 6 10 0 0 # ⌂ + +# Extended characters +161: 0 72 6 10 0 # ¡ +191: 8 72 6 10 0 # ¿ +192: 16 72 6 16 6 # À +193: 24 72 6 16 6 # Á +200: 32 72 6 16 6 # È +201: 40 72 6 16 6 # É +204: 48 72 6 16 6 # Ì +205: 56 72 6 16 6 # Í +210: 64 72 6 16 6 # Ò +211: 72 72 6 16 6 # Ó +217: 80 72 6 16 6 # Ù +218: 88 72 6 16 6 # Ú +209: 96 72 6 14 4 # Ñ +241: 104 72 6 12 2 # ñ +199: 112 72 6 10 0 # Ç +231: 120 72 6 10 0 # ç +224: 0 90 6 14 4 # à +225: 8 90 6 14 4 # á +232: 16 90 6 14 4 # è +233: 24 90 6 14 4 # é +236: 32 90 6 14 4 # ì +237: 40 90 6 14 4 # í +242: 48 90 6 14 4 # ò +243: 56 90 6 14 4 # ó +249: 64 90 6 14 4 # ù +250: 72 90 6 14 4 # ú diff --git a/data/X2_font.gif b/data/X2_font.gif new file mode 100644 index 0000000000000000000000000000000000000000..4b97ecb17147217e35d8fce1f6585437e3abc06c GIT binary patch literal 1260 zcmVjzUwz-{6xL#B8p-Z6x<`oY0i0^qi}h2E`JB(uRV2MD3%%s7L?Bx+)Nv z)~#H-dj0xUWYcs+@;F75P@_7O?Z!>{py=n=h0uy>{IhngK6F4a&cYKgrp2r{b0MLb zmarVQiG}D>IhZBly@a!RBs;S4i!(kW8ZOK5Bvr(ty_{nF4zSv0pL67ib+58te-BPS zmZv7L&B#PsCoaspEo$7pA>W>?Std-zy>xdh?y;}Y%w~t@-QtwB=1qDNa_?K+sx!Pm z0ov6bvnts2?AyD459;CU&_0iYh~d1h>wWwFtzw=o&UAJqhu>zl5!hJ`jYzWwN(UOp zj&t|bHk@xaP(m4W$5p0WKNA`_7&;tcVi-aTW+s$4%h?AaKKh9`B8gbF;+c0XiF8w1 zAHql%jr<8i|-HB(OdhW?*pHcV;s4+~cNGMg;%{9-V6+$H^ zQgrY{-j^>XsGFi3P{)LHX3c~kK^e*>MmaHwk9(< z#>OUEis`XoJhLJNA)AopS|F|HE$aTHjc0`^*j>uXnWzoNqROeH3mJ-Op$?XJDNY`sx9OSnCAVXKxMsJy_0rWy}D}7 zWO{8Yeg7V;v2qPlIw0hPUeCLDeuM8@dC92;$GF7WwoAFfjf2{)=$@-A5xR%F%eu^` zziuqs@2`u`08|gUbKLaYSc6=+H@tzmJhq*3yFv}D4mX*N)2IwjOi`4`} WSUuLM4Sy_bp$lIK!x$Q%002ALEQWOe literal 0 HcmV?d00001 diff --git a/data/intro.lua b/data/intro.lua index 19f2e1b..491b796 100644 --- a/data/intro.lua +++ b/data/intro.lua @@ -1,11 +1,3 @@ -require "fps" -require "fade" -require "game" - --- require "mapa" --- require "scenes" - -local arcade_config = require("arcade_config") o2aX = arcade_config.org2arc_escala intro_wait=40 @@ -16,35 +8,35 @@ function intro_init() intro_wait=400 surf.cls(16) - surf.target(logo) + local font_default = font.current() + font.current(font_sf) + surf.target(back) surf.cls(16) - draw.text("INTRO_INIT",0,0,15) + draw.text("INTRO INIT",0,0,15) + font.current(font_default) surf.target(0) - surf.source(logo) - draw.surf(0,0,36,5,56,70,arcade_config.logo_sf.width,arcade_config.logo_sf.height) + surf.source(back) + draw.surf(0,0,63,10,100,100,126,20) -- surf.source(tiles) fade.fadein() + print("INTRO INIT") end function intro_intro() intro_wait=intro_wait-1 + if intro_wait==0 or key.press(key.ESCAPE) or key.press(keyShoot) or pad.press(btnShoot) or pad.press(btnPause) then intro_wait=1 game_update = intro_update fade.fadeoutin() end - end function intro_update() fps_print() - if key.press(key.ESCAPE) or pad.press(btnPause) then - game_init(true) - fade.fadeoutin() - elseif key.press(key.SPACE) then - intro_wait=1 - end + game_init(true) + fade.fadeoutin() end diff --git a/data/logo.lua b/data/logo.lua new file mode 100644 index 0000000..6108a75 --- /dev/null +++ b/data/logo.lua @@ -0,0 +1,131 @@ +local logo_step=1 +local logo_step_wait=0 +local logo_anim={} +local step1_finished = false +local brillo_y = 10 +local logo_wait = 400 + +function logo_anim_init () + logo_anim={ [1] = {x0=-126, y=80, w=126, h=4, speed= 1, accel= 0.25, x1=65, delay=0}, + [2] = {x0= 256, y=84, w=126, h=4, speed=-1, accel=-0.25, x1=65, delay=4}, + [3] = {x0=-126, y=88, w=126, h=4, speed= 1, accel= 0.25, x1=65, delay=8}, + [4] = {x0= 256, y=92, w=126, h=4, speed=-1, accel=-0.25, x1=65, delay=12}, + [5] = {x0=-126, y=96, w=126, h=4, speed= 1, accel= 0.25, x1=65, delay=16}} +end + +function logo_init() + game_update = logo_intro + surf.cls(16) + + local font_default = font.current() + font.current(font_sf) + surf.target(back) + surf.cls(16) + draw.text("JAILGAMES",0,0,15) + draw.text("presenta",0,20,14) + draw.text("JAILGAMES",0,40,2) + font.current(font_default) + surf.target(0) + logo_anim_init() +end + +function logo_intro() + logo_wait=logo_wait-1 + + if logo_wait==0 or key.press(key.ESCAPE) or key.press(keyShoot) or pad.press(btnShoot) or pad.press(btnPause) then + logo_wait=1 + game_update = logo_update + fade.fadeoutin() + end + + surf.source(back) + surf.target(0) + surf.cls(16) + + -- Animació per a l'aparició del logo + if logo_step==1 then + draw.surf(0,0,63,2, logo_anim[1].x0,logo_anim[1].y,logo_anim[1].w,logo_anim[1].h) + draw.surf(0,2,63,2, logo_anim[2].x0,logo_anim[2].y,logo_anim[2].w,logo_anim[2].h) + draw.surf(0,4,63,2, logo_anim[3].x0,logo_anim[3].y,logo_anim[3].w,logo_anim[3].h) + draw.surf(0,6,63,2, logo_anim[4].x0,logo_anim[4].y,logo_anim[4].w,logo_anim[4].h) + draw.surf(0,8,63,2, logo_anim[5].x0,logo_anim[5].y,logo_anim[5].w,logo_anim[5].h) + + step1_finished = true + logo_step_wait = logo_step_wait+1 + if logo_step_wait>=1 then + logo_step_wait = 0 + for i, data in ipairs(logo_anim) do + local check = false + if logo_anim[i].accel>=0 then + check = logo_anim[i].x0+logo_anim[i].speedlogo_anim[i].x1 + end + if check then + if logo_anim[i].delay==0 then + logo_anim[i].x0 = logo_anim[i].x0 + logo_anim[i].speed + logo_anim[i].speed = logo_anim[i].speed + logo_anim[i].accel + else + logo_anim[i].delay=logo_anim[i].delay-1 + end + step1_finished = step1_finished and false + else + logo_anim[i].x0 = logo_anim[i].x1 + step1_finished = step1_finished and true + end + end + end + + if step1_finished then logo_step=2 end + + end + + -- presenta + if logo_step==2 then + -- draw.surf(0,0, 63,10, 65,80,126,20); -- JAILGAMES + draw.surf(0,0,63,10, logo_anim[1].x0,logo_anim[1].y,logo_anim[1].w,logo_anim[1].h*5); -- JAILGAMES + draw.surf(0,20,55,10, 100,102,55,10); -- presenta + logo_step = 3 + end + + -- pausa + if logo_step==3 then + draw.surf(0,0,63,10, logo_anim[1].x0,logo_anim[1].y,logo_anim[1].w,logo_anim[1].h*5); -- JAILGAMES + draw.surf(0,20,55,10, 100,102,55,10); -- presenta + logo_step_wait = logo_step_wait+1 + if logo_step_wait>=20 then + logo_step_wait = 0 + logo_step = 4 + end + end + + -- Brillo + if logo_step==4 then + draw.surf(0,0,63,10, logo_anim[1].x0,logo_anim[1].y,logo_anim[1].w,logo_anim[1].h*5); -- JAILGAMES + draw.surf(0,20,55,10, 100,102,55,10); -- presenta + + logo_step_wait = logo_step_wait+1 + if logo_step_wait>=1 then + logo_step_wait = 0 + draw.surf(0,40+math.floor(brillo_y),63,1, + logo_anim[1].x0, logo_anim[1].y+math.floor(brillo_y*2), logo_anim[1].w, 1); + + brillo_y = brillo_y-0.5 + + if brillo_y==0 then logo_step = 5 end + end + end + + -- Final + if logo_step>=5 then + draw.surf(0,0,63,10, logo_anim[1].x0,logo_anim[1].y,logo_anim[1].w,logo_anim[1].h*5); -- JAILGAMES + draw.surf(0,20,55,10, 100,102,55,10); -- presenta + if logo_step==5 then logo_wait = 75 end + logo_step = 6 + end +end + +function logo_update() + fps_print() + intro_init() +end \ No newline at end of file diff --git a/data/main.lua b/data/main.lua index 9252c20..525253c 100644 --- a/data/main.lua +++ b/data/main.lua @@ -1,10 +1,15 @@ +arcade_config = require("arcade_config") + +require "fps" require "fade" require "audio" -require "intro" -require "switches" +require "mapa" require "map" - -local arcade_config = require("arcade_config") +require "logo" +require "intro" +require "game" +require "switches" +-- require "scenes" function load_tilemap( sf_mapa ) local mapa_tw, mapa_th = surf.size(sf_mapa) @@ -46,6 +51,8 @@ function mini.init() sf_mapa=surf.new(mapa_room_cols*mapa_rooms_per_piso,mapa_room_rows*mapa_pisos) load_tilemap( sf_mapa ) fade.init() + + font_sf=font.load("X2_font.fnt") textsf=surf.new(arcade_config.org_resolucion.width,arcade_config.org_resolucion.height) @@ -84,8 +91,9 @@ function mini.init() btnCycle2 = tonumber(config.key("btncycle2")) or pad.LEFTSHOULDER btnPause = tonumber(config.key("btnpause")) or pad.START - game_init() + -- game_init() -- intro_init() + logo_init() -- final_init() end @@ -121,7 +129,7 @@ function arc_text(str, x, y, col) surf.source(curr_surf_src) end -function arc_textB(str, x, y, col) +function arc_textB(str, x, y, col, colB) local ox, oy = view.origin() local curr_surf_tgt = surf.target() local curr_surf_src = surf.source() @@ -129,17 +137,18 @@ function arc_textB(str, x, y, col) local sh = arcade_config.org_resolucion.height local dw = arcade_config.resolucion.width local dh = arcade_config.resolucion.height + colB = colB or 16 surf.target(textsf) view.origin(0,0) surf.cls(0) - draw.text(str,0,0,16) - draw.text(str,1,0,16) - draw.text(str,2,0,16) - draw.text(str,0,1,16) - draw.text(str,2,1,16) - draw.text(str,0,2,16) - draw.text(str,1,2,16) - draw.text(str,2,2,16) + draw.text(str,0,0,colB) + draw.text(str,1,0,colB) + draw.text(str,2,0,colB) + draw.text(str,0,1,colB) + draw.text(str,2,1,colB) + draw.text(str,0,2,colB) + draw.text(str,1,2,colB) + draw.text(str,2,2,colB) draw.text(str,1,1,col) -- print("arc_B "..str) @@ -148,4 +157,36 @@ function arc_textB(str, x, y, col) view.origin(ox,oy) draw.surf(0,0,sw,sh,x,y,dw,dh) surf.source(curr_surf_src) +end + +function arc_textB2(str, x, y, col, colB) + local ox, oy = view.origin() + local curr_surf_tgt = surf.target() + local curr_surf_src = surf.source() + local sw = arcade_config.org_resolucion.width + local sh = arcade_config.org_resolucion.height + local dw = arcade_config.resolucion.width + local dh = arcade_config.resolucion.height + colB = colB or 16 + surf.target(textsf) + view.origin(0,0) + surf.cls(0) + draw.text(str,0,0,colB) + draw.text(str,1,0,colB) + draw.text(str,2,0,colB) + draw.text(str,0,1,colB) + draw.text(str,2,1,colB) + draw.text(str,0,2,colB) + draw.text(str,1,2,colB) + draw.text(str,2,2,colB) + + draw.text(str,1,1,col) + -- print("arc_B "..str) + surf.source(textsf) + + surf.target(curr_surf_tgt) + view.origin(ox,oy) + -- draw.surf(0,0,sw,sh,x,y,dw,dh) + draw.surf(0,0) + surf.source(curr_surf_src) end \ No newline at end of file