i'll have mouse with that!
Shriek: working on it..
cyberdragon: you need lua ~ or something...
.. Cat...
Well you see it chases the mouse, and the mouse will get the cheese.
plenty of fail, plenty of infinite loops...
and there must be cheese or mouse infiniteloops, there must be mouse or cat infiniteloops. i'll get the cat-shaped thing later.
sigh...
Here goes!
tpt.el.dust.name="mous"
tpt.el.dust.description="Squeak!"
tpt.el.brel.name="cat"
tpt.el.brel.description="Miaow!"
tpt.el.spng.name="CHES"
tpt.el.spng.description="Cheese for mouse."
math.randomseed(os.time())
function findcheese (i,x,y,s,n)
a=math.random(1,611)
b=math.random(1,383)
while tpt.get_property("type",a,b)~=tpt.el.spng.id do
a=math.random(1,611)
b=math.random(1,383)
end
if x<a then
tpt.set_property("vx",1,i)
elseif x>a then
tpt.set_property("vx",-1,i)
else
tpt.set_property("vx",0,i)
end
if y<b then
tpt.set_property("vy",1,i)
elseif y>b then
tpt.set_property("vy",-1,i)
else
tpt.set_property("vy",0,i)
end
end
function findmous (i,x,y,s,n)
c=math.random(1,611)
d=math.random(1,383)
while tpt.get_property("type",c,d)~=tpt.el.dust.id do
c=math.random(1,611)
d=math.random(1,383)
end
e=x-c
f=y-d
if e==1 or e==-1 or e==0 then
if f==1 or f==-1 or f==0 then
tpt.delete(c,d)
end
end
if x<c then
tpt.set_property("vx",1,i)
elseif x>c then
tpt.set_property("vx",-1,i)
else
tpt.set_property("vx",0,i)
end
if y<d then
tpt.set_property("vy",1,i)
elseif y>d then
tpt.set_property("vy",-1,i)
else
tpt.set_property("vy",0,i)
end
end
function geteaten(i,x,y,s,n)
j=math.random(-1,1)
k=math.random(-1,1)
if tpt.get_property("type",x+j,y+k)==tpt.el.dust.id then
tpt.delete (i)
end
end
tpt.element_func(findcheese,tpt.el.dust.id)
tpt.element_func(geteaten,tpt.el.spng.id)
tpt.element_func(findmous,tpt.el.brel.id)
Okay now change this to be compatible with the latest version... because the line "tpt.el.NAME.name = 'name' " no longer works