All pastes #596542 Raw Edit

yuriks

public lua v1 · immutable
#596542 ·published 2007-06-30 00:49 UTC
rendered paste body
ENT.name = "Test object."ENT.desc = "Sits there doing nothing."ENT.author = "yuriks"-- Guaranteed to be called at least once-- Here you should load all needed resourcesfunction ENT:precache()	if (not self.global.data['idle_sprite']) then -- Please, always make these checks		self.global.data['idle_sprite'] = disk.loadSprite("images/idle.png")	endend-- Called when the entity is created (not spawned!)function ENT:create()	-- Do nothing.end-- Called when the entity is drawnfunction ENT:draw()	screen.drawSprite(self.global.data['idle_sprite'], self.getPos())endfunction ENT:think(time)	-- Time is number of ticks (seconds) since last update	-- ideally this will be called once per frame, but bad stuff may happen.	-- Do nothing. =Dend-- Note: you may omit any empty functions