Browse Source

minor changes

pixelbath 1 year ago
parent
commit
d7cc3f8245
2 changed files with 95 additions and 0 deletions
  1. 29 0
      bomberguy.lua
  2. 66 0
      harvest.lua

+ 29 - 0
bomberguy.lua

@@ -32,6 +32,7 @@ items={
 }
 
 field_offset={10,10}
+field_data={}
 
 spr_block=32
 spr_block_dis={34,36,38,40,42,44}
@@ -41,6 +42,34 @@ function draw_player()
 	spr(256, p1.x+field_offset[1], p1.y+field_offset[2], 0, 1, 0, 0, 2, 2)
 end
 
+-- on a 4:3 screen:
+-- fixed tile width: 15
+-- fixed tile height: 13
+
+-- Bomberman 1:
+-- total width: 17
+-- total height: 13
+
+function generate_level(level_num, is_bonus)
+	field_data={}
+	for y=0,12 do
+		for x=0,16 do
+			field_data[y][x] = 0
+			local draw_cell = false
+			if x==0 or x==16 then
+				draw_cell = true
+			end
+			if not draw_cell and math.fmod(y, 2) and math.fmod(x, 2) == 0 then
+				draw_cell = true
+			end
+
+			if draw_cell then
+				field_data[y][x] = 1
+			end
+		end
+	end
+end
+
 
 function TIC()
 	if btn(0) then

+ 66 - 0
harvest.lua

@@ -0,0 +1,66 @@
+-- title:   game title
+-- author:  game developer, email, etc.
+-- desc:    short description
+-- site:    website link
+-- license: MIT License (change this to your license of choice)
+-- version: 0.1
+-- script:  lua
+
+t=0
+x=96
+y=24
+
+function TIC()
+
+	if btn(0) then y=y-1 end
+	if btn(1) then y=y+1 end
+	if btn(2) then x=x-1 end
+	if btn(3) then x=x+1 end
+
+	cls(13)
+	spr(1+t%60//30*2,x,y,14,3,0,0,2,2)
+	print("HELLO WORLD!",84,84)
+	t=t+1
+end
+
+-- <TILES>
+-- 000:6666666666666666666666666666666666666666666666666666666666666666
+-- 001:6666666666666666666666666666666666666666666666666666666666666666
+-- 002:3333333333333333333333333333333333333333333333333333333333333333
+-- 003:3333333333333333333333333333333333333333333333333333333333333333
+-- 004:3333333333333333333333333333333333333333333333333333333333333333
+-- 005:3333333333333333333333333333333333333333633333336333333363333333
+-- 006:3333333333333333333333333333333333333333333333663333333333333333
+-- 007:3333333333333333333333333333333333333333633333336333333363333333
+-- 008:3333333333333333333333333333333333333333333333663333333333333333
+-- 009:3333333333333333333333333333333333333333633333336333333363333333
+-- 016:6666666666666666666666666666666666666666666666666666666666666666
+-- 017:6666666666666666666666666666666666666666666666666666666666666666
+-- 018:3333333333333333333333333333333333333333333333333333333333333333
+-- 019:3333333333333333333333333333333333333333333333333333333333333333
+-- 020:3333333333333333333333333333333333333333333333333333333333333333
+-- 021:6333333363333333633333336333333333333333333333333333333333333333
+-- 022:3333336633333363333333633333336633333333333333333333333333333333
+-- 023:6333333333333333333333336333333333333333333333333333333333333333
+-- 024:3333336633333333333333333333336633333333333333333333333333333333
+-- 025:6333333363333333633333336333333333333333333333333333333333333333
+-- </TILES>
+
+-- <WAVES>
+-- 000:00000000ffffffff00000000ffffffff
+-- 001:0123456789abcdeffedcba9876543210
+-- 002:0123456789abcdef0123456789abcdef
+-- </WAVES>
+
+-- <SFX>
+-- 000:000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000304000000000
+-- </SFX>
+
+-- <TRACKS>
+-- 000:100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
+-- </TRACKS>
+
+-- <PALETTE>
+-- 000:1a1c2c5d275db13e53ef7d57ffcd75a7f07038b76425717929366f3b5dc941a6f673eff7f4f4f494b0c2566c86333c57
+-- </PALETTE>
+