ID:1678536
 
(See the best response by Sir Lazarus.)
obj
Hook
var
celsium
length = 1
speed = 0.1
matrix/X
active = TRUE
icon = 'Objects.dmi'
icon_state="Hook"
New(/**/)
Moving(/**/)
..(/**/)
proc
Moving(/**/)
while(active)
if(active==FALSE)
break
for(var/celsium;celsium<40;celsium++)
if(active==FALSE)
break
X = new
X.Scale(1, length)
X.Translate(0, length/2)
X.Turn(celsium*2)
transform = X
sleep(speed)
for(var/celsium=-40;celsium<0;celsium++)
if(active==FALSE)
break
X = new
X.Scale(1, length)
X.Translate(0, length/2)
X.Turn(celsium*-2)
transform = X
sleep(speed)
for(var/celsium;celsium<40;celsium++)
if(active==FALSE)
break
X = new
X.Scale(1, length)
X.Translate(0, length/2)
X.Turn(celsium*-2)
transform = X
sleep(speed)
for(var/celsium=-40;celsium<0;celsium++)
if(active==FALSE)
break
X = new
X.Scale(1, length)
X.Translate(0, length/2)
X.Turn(celsium*2)
transform = X
sleep(speed)
sleep(1)
Grab(/**/)
X.Turn(celsium*2)
transform = X

sleep(6)
if(src)
active=TRUE
Moving(/**/)

mob
verb
Trigger(/**/)
for(var/obj/Hook/M in world)
M.active=FALSE
M.Grab(/**/)


I want to make same effect as on gold miner. But i dont know how should I make Grab() verb walk in celsium direction and than return. Also it would be able to bumb into minerals.
*Spam*
Best response
Phat T wrote:
I want to make same effect as on gold miner.

What's a gold miner?

But i dont know how should I make Grab() verb walk in celsium direction and than return.

Did you mean "celsius"?

Also it would be able to bumb into minerals.

I assume you meant "bump", but I still don't understand your question.

Perhaps you could elaborate? Please, take your time.
It looks like this:

http://www.androidfreeware.net/img2/ gold_miner_free_android_3.gif

The hook is moving left and right and when you press button to trigger to Grab it should stop moving and went down. If the hook hits the gold / diamon atc it would do the specific effect for it.

Im using X.Turn(celsium*-2) proc to rotate the hook and i dont know how could I code the hook to stop and went down to the line the icon is turned.