I made this onster for my megaman game. Its supposed to go right and left. If th eleft is blocked it goes left, ect.
It does do anything tho...it jsut sits there.
Bumper_Left
name = ""
icon = 'Bads.dmi'
icon_state = "thingy"
density = 1
HP = 10
New()
..()
src.Left()
proc/Left()
while(src)
var/atom/check = locate(src.x-1,src.y,src.z)
if(check.density==1)
sleep(1)
src.Right()
else
step(WEST,src)
sleep(1)
src.Left()
proc/Right()
while(src)
var/atom/check = locate(src.x+1,src.y,src.z)
if(check.density==1)
sleep(1)
src.Left()
else
step(EAST,src)
sleep(1)
src.Right()
ID:147345
Jun 26 2004, 7:16 pm
|
|
Jun 27 2004, 2:13 pm
|
|
I'm not good with platformers and i did play with this code for a bit and came up with nothing..Sorry i was no help =(
|
Bumper_Left
name = "" icon = 'Bads.dmi' icon_state = "thingy" density = 1 HP = 10 New() ..() src.Left() proc/Left() while(src) var/atom/check = locate(src.x-1,src.y,src.z) if(check.density==1) sleep(1) src.Right() else step(src,WEST) sleep(1) src.Left() proc/Right() while(src) var/atom/check = locate(src.x+1,src.y,src.z) if(check.density==1) sleep(1) src.Left() else step(src,EAST) sleep(1) src.Right() You had the arguments in the Step() proc switched around |
I hope you dont mien me using this since i got it to work. heres the code.
mob Guy icon = 'Bass.dmi' Life = 20 dir = 4 proc Left() var/atom/check = locate(src.x-1,src.y-1,src.z) if(check.density==0) sleep(6) src.Right() else src.loc=locate(src.x-1,src.y,src.z) sleep(6) src.Left() proc Right() var/atom/check = locate(src.x+1,src.y-1,src.z) if(check.density==0) sleep(6) src.Left() else src.loc=locate(src.x+1,src.y,src.z) sleep(6) src.Right() New()//Create something Left()//Calls the proc when it is created |
In response to Snowfox
|
|
I thought someone stole my old key until I saw the date ROFL.
|