aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRibbon <ambiguousmachine@gmail.com>2022-02-14 17:10:20 -0800
committerRibbon <ambiguousmachine@gmail.com>2022-02-14 17:10:20 -0800
commitae63d9af57038cc8b0027136f741c190b6f19083 (patch)
treeb5214755ddf1ebdb9f0a07be8bf3c7b94bb1dd5b
parentbd12de76d95361f59d148ebfa97df5d49fc6ddd4 (diff)
Added printdropshadow(), changed some bg stuff
MUST OBTAIN MORE TOKENS
-rw-r--r--background.lua13
-rw-r--r--draw.lua14
-rw-r--r--ui.lua46
3 files changed, 31 insertions, 42 deletions
diff --git a/background.lua b/background.lua
index dc82aba..b96bf02 100644
--- a/background.lua
+++ b/background.lua
@@ -78,18 +78,21 @@ function drawbg()
camera((sin(shake+t())*shake)/2, (sin(shake+gt/2.1)*shake)/2)
+
--landscape
scrollingcirclelines(125, 72, 25, 20, 8)
scrollingcircles(126, 72, 25, 20, 2)
+
--landscape lines
- line(0, 112, 128, 112, 8)
- line(0, 114, 128, 114, 8)
- line(0, 116, 128, 116, 8)
- line(0, 117, 128, 117, 8)
- rectfill(0,119,128,128,8)
+ rectfill(0,112,128,128,8)
+ line(0, 113, 128, 113, 2)
+ line(0, 116, 128, 116, 2)
+ line(0, 119, 128, 119, 2)
+
for i = 1, 32, 1 do
line(((-gt+i*2.5)*80)%128, 111, ((-gt+i*2.5)*80)%128*1.2-12.8, 125, 2)
end
+
--pine trees
scrollingsprite(231,10,78+16,1,2,72,true)
scrollingsprite(231,30,78+16,1,2,72)
diff --git a/draw.lua b/draw.lua
index f4f8e6c..0366777 100644
--- a/draw.lua
+++ b/draw.lua
@@ -15,23 +15,19 @@ drawbg()
drawobjs()
if gamerunning then
- if gameover then --gameover timer, it does a cute spinny!
- print(ceil(respawntimer), 62+sin(t())*3,61+cos(t())*3, 5)
- print(ceil(respawntimer), 62+sin(t())*3,60+cos(t())*3, 6)
+ if gameover then --gameover timer, it does a cute spinny! 😵
+ printdropshadow(ceil(respawntimer),63+sin(t())*3,55+cos(t())*3,6,5)
elseif players[1].health <=0 then
- print(ceil(players[1].inv), players[1].x+sin(t())*3, players[1].y+cos(t())*3+1, 15)
- print(ceil(players[1].inv), players[1].x+sin(t())*3, players[1].y+cos(t())*3, 12)
+ printdropshadow(ceil(players[1].inv),players[1].x+sin(t())*3,players[1].y+cos(t())*3,12,15)
elseif #players > 1 and players[2].health <=0 then
- print(ceil(players[2].inv), players[2].x+sin(t())*3, players[2].y+cos(t())*3+1, 2)
- print(ceil(players[2].inv), players[2].x+sin(t())*3, players[2].y+cos(t())*3, 9)
+ printdropshadow(ceil(players[2].inv),players[2].x+sin(t())*3,players[2].y+cos(t())*3,9,2)
end
end
if not gamerunning or menuscroll < 1 then
menuscroll += scrollspeed
if not gamerunning then menushipscroll += 1/60 end
for i = 1, 3, 1 do
- spr(basicenemysprites[i%#basicenemysprites+1], (-menushipscroll*(i*20)+(sin(i/3)*128)+8)%(128+8)-1*8-menuscroll*240, i*36+sin(menushipscroll*i/3)*i*2-20-menuscroll*50,1,1)
- end
+ spr(14+i*16, (-menushipscroll*(i*20)+(sin(i/3)*128)+8)%(128+8)-1*8-menuscroll*240, i*36+sin(menushipscroll*i/3)*i*2-20-menuscroll*50,1,1) end
if t() < 1 then
drawlogo(24-menuscroll*120,19.5+sin(0.25+t()*0.5)*6.5)
else
diff --git a/ui.lua b/ui.lua
index 1709885..eeeb530 100644
--- a/ui.lua
+++ b/ui.lua
@@ -1,6 +1,11 @@
menuscroll = 0
menushipscroll = 0
+function printdropshadow(text,x,y,colorMain,colorShadow)
+ print(text,x,y+1,colorShadow)
+ print(text,x,y,colorMain)
+end
+
function invaderslogotext(x,y)
--default values
-- x = 12
@@ -8,7 +13,6 @@ function invaderslogotext(x,y)
--font
local text = "i n v a d e r s"
- print(text, x, y+1, 3)
print(text, x, y-1, 3)
print(text, x+1, y, 3)
print(text, x-1, y, 3)
@@ -20,10 +24,11 @@ function invaderslogotext(x,y)
print(text, x-1, y+2, 3)
print(text, x+1, y+2, 3)
print(text, x, y+2, 3)
- print(text, x, y, 14)
- clip(x, y, 60, 3)
- print(text, x, y, 11)
+ printdropshadow(text,x,y,14,3)
+ clip(x, y, 63, 3)
+ print(text,x,y,11)
clip()
+
end
function drawlogo(x,y)
@@ -55,10 +60,8 @@ function mainmenutext(x,y)
spr(17,x+2,y+4+sin(t()*0.7)*2,1,1) --blue ship
spr(33,x+2,y+16+sin(t()*0.7)*2,1,1) --orange ship
end
- print("(\142) - lone wolf", x+15,y+7,5)
- print("(\142) - lone wolf", x+15,y+6,6)
- print("(\151) - companion", x+15,y+18,5)
- print("(\151) - companion", x+15,y+17,6)
+ printdropshadow("(\142) - lone wolf",x+15,y+7,6,5)
+ printdropshadow("(\151) - companion",x+15,y+18,6,5)
end
function titlehighscores(x,y)
@@ -66,14 +69,9 @@ function titlehighscores(x,y)
-- 52
-- 110
- --1P high score
- print("000000", x-20,y+1,15)
- print("000000", x-20,y,12)
- print("-", x+10,y+1,5)
- print("-", x+10,y,6)
- --2P high score
- print("000000", x+20,y+1,2)
- print("000000", x+20,y,9)
+ printdropshadow("000000",x-20,y,12,15) --1P high score
+ printdropshadow("-",x+10,y,6,5)
+ printdropshadow("000000",x+20,y,9,2) --2P high score
end
function credits(x,y)
@@ -87,14 +85,10 @@ function credits(x,y)
spr(49,x+104,y+6+cos(t())*2,1,1,(t()%2<1)) --bot
palt(2,false)
palt(0,true)
- print("1029chris", x+10,y+6,2)
- print("1029chris", x+10,y+5,9)
- print("ribboncable", x+56,y+6,15)
- print("ribboncable", x+56,y+5,12)
- print("code tunes", x+8,y+13,3)
- print("code tunes", x+8,y+12,11)
- print("sprites sfx", x+56,y+13,3)
- print("sprites sfx", x+56,y+12,11)
+ printdropshadow("1029chris",x+10,y+5,9,2)
+ printdropshadow("ribboncable",x+56,y+5,12,15)
+ printdropshadow("code tunes",x+8,y+12,11,3)
+ printdropshadow("sprites sfx",x+56,y+12,11,3)
-- print("made in vancouver - 2022", x+6,y+22,0)
-- print("made in vancouver - 2022", x+6,y+21,4)
@@ -103,10 +97,6 @@ end
--sfx for the intro transition
sfx(13,3)
--- drawlogo(24,26)
--- mainmenutext(24,62)
--- credits(10,100)
-
--this creates menu items that allow players to turn off screenshake, or always fire the ships gun.
doshake = true
menuitem(1, "(\129) screenshake", function() doshake = not doshake end)