ID:171118
 
Heres all my current coding for a castlevania game im working on:
turf
cliff
icon = 'turfs.dmi'
icon_state = "cliff"
density = 1
cliff2
icon = 'turfs.dmi'
icon_state = "cliff2"
density = 1
sky
icon = 'turfs.dmi'
icon_state = "sky"
cliff3
name = "cliff"
icon = 'turfs.dmi'
icon_state = "bg"
water
icon = 'turfs.dmi'
icon_state = "water"
Enter(mob/M)
M << "You drown in the water!"
M.Die()
water2
name = "water"
icon = 'turfs.dmi'
icon_state = "water2"
Enter(mob/M)
M << "You drown in the water!"
M.Die()

mob/proc/Die()
usr.HP = usr.MHP
usr.loc = locate(/area/start)
world << "[usr] was killed!"

mob/var
HP = 30
MHP = 30
MP = 20
MMP = 20
STR = 7
DEF = 4

area/start

world
mob = /mob/pc
turf = /turf/sky

mob/pc
icon = 'pc.dmi'

mob/Login()
world << "[usr] joined Castlevania!"
usr.loc = locate(/area/start)
src.client.mob.dir = EAST
src.inair = 0


Also here is the side scroll coding im using:
    #define DEBUG
proc
Gravity(var/mob/per)
if(per.dir == EAST)
if(per.inair == 1)
var/turf/check = locate(per.x,per.y-1,per.z)
if(check.density == 1)
per.inair = 0
return
else
per.loc=locate(per.x,per.y-1,per.z)
sleep(2)
Gravity(per)
else
return 0
if(per.dir == WEST)
if(per.inair == 1)
var/turf/check = locate(per.x,per.y-1,per.z)
if(check.density == 1)
per.inair = 0
return
else
per.loc=locate(per.x,per.y-1,per.z)
sleep(2)
Gravity(per)
else
return 0

mob
var
inair

client
Northeast()
return
Northwest()
return
Southeast()
return
Southwest()
return
North()
if(src.mob.dir == EAST)
if(src.mob.inair == 0)
src.mob.inair = 1
for(var/i=1,i<4,i++)
src.Move(locate(src.mob.x,src.mob.y+1,src.mob.z),NORTH)
src.mob.dir = EAST
sleep(2)
Gravity(src.mob)
return
else
return
if(src.mob.dir == WEST)
if(src.mob.inair == 0)
src.mob.inair = 1
for(var/i=1,i<4,i++)
src.Move(locate(src.mob.x,src.mob.y+1,src.mob.z),NORTH)
src.mob.dir = WEST
sleep(2)
Gravity(src.mob)
return
else
return
East()
..()
if(src.mob.inair == 0)
var/turf/checkdense = locate(src.mob.x,src.mob.y-1,src.mob.z)
if(checkdense.density == 0)
src.mob.inair = 1
Gravity(src.mob)
return

West()
..()
if(src.mob.inair == 0)
var/turf/checkdense = locate(src.mob.x,src.mob.y-1,src.mob.z)
if(checkdense.density == 0)
src.mob.inair = 1
Gravity(src.mob)
return
South()
if(src.mob.inair == 1)
return


Now heres the problem..for some reason when the mob falls into the water, instead of killing him, the mob falls through the water until he hits a dense surface. He wont die unless the mob moves once hes inside the water. Can someone tell me how to fix it so the mob dies the SECOND he henters the water? this has been annoying me for quite some time now. Thanks in advance



You can try Entered() That might work better.
In response to N1ghtW1ng
yeah that sounds right
In response to Covering Fire
bump() ?
ID: 299747

Entered() should work, like they said. Why? When they hit the water, GRAVITY is pushing them down, they never chose to move downwards. If you use entered(), they'll die when they've entered() the water. Make sense?