
-- an enemy that just jumps in place, on a timer

Jumper = class(Object, function(o, x, y, size)
	Object.init(o, x, y, size, size)
	o.moves = true
	o.immovable = false
	o.y_speed = 1200
	o.velocity = Vec2(0, 0)
	o.acceleration = Vec2(0, o.y_speed)
	o.sprite = sprites["tiles"]["white.png"]
	o.drawType = "stretched"
	o.tint = {r=230, g=30, b=50, a=255}

	o._jumpPower = 200;
	o.jumpTime = 1
	o.jumpCounter = o.jumpTime
	o.note = math.random()
end)

Jumper.tName = "Jumper"

function Jumper:update()
	if self.touching.DOWN then
		if self.jumpCounter > 0 then
			self.jumpCounter = self.jumpCounter - bludG.elapsed
		else
			pd:startList("fromOF")
			pd:addSymbol("sync")
			pd:addFloat(1)
			pd:finish("fromOF");

			print("should play", 3, 2, 0, 0, 1, 0, 0, 1, self.note)
			-- WorldPlay(id, ttype, skin, hat, onNode, onBeat, harvest, onScreen, unquantized)
			WorldPlay(3, 5, 0, 0, 1, 0, 0, 1, self.note)
			self.jumpCounter = self.jumpTime
			self.velocity.y = -800
		end
	end
	Object.update(self)
end
