Moon (Assets)

Retourner au jeu

Vous pouvez utiliser ces fichiers mais pensez à me créditer :p

La cartouche
Les sprites

Code


--moon (1hgj)
--by bigaston

score=0
g=0.1

function _init()
	fuse={}
	fuse.x=56
	fuse.y=0
	fuse.dx=0
	fuse.dy=0.5
	
	base={}
	base.x=flr(rnd(112))
	base.y=103
	
	
	game_over=false
	win=false
end

function _update()
	if not game_over then
		if not win then
			move_y()
			move_x()
			sound()
			test_win()
			death()
		end
	end
	
	if game_over then
		if (btnp(5)) then
			g=0.1
			score=0
			_init()
		end
	end
end

function _draw()
	cls()
	
	rectfill(44,1,87,10,0)
	print("★score:"..score,47,4,5)
	print("★score:"..score,46,3,7)
	rect(44,1,87,10,7)
	
	if (btn(2)) then
		spr(3,fuse.x,fuse.y,2,2)
	else
		spr(1,fuse.x,fuse.y,2,2)
	end
	
	spr(7,base.x,base.y,2,2)
	
	rectfill(0,119,127,127,5)
	print("create in 1h for the 143nd 1hgj",3,122,7)
	
	if game_over then
		print("game over, your score is "..score,11,55,5)	
		print("game over, your score is "..score,10,54,7)
		print("press ❎ for restart",27,62,5)
		print("press ❎ for restart",26,61,7)
	end
end