Im having troubles with z_print.
the fonts are been writen in a black layer, without aplying alpha.
should I apply something else?
the fonts are been writen in a black layer, without aplying alpha.
should I apply something else?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Show posts MenuTYPE TEnemy
x
y
w
h
dx
dy
speed
life
path[]
pathlength
ENDTYPE
FUNCTION SpawnEnemy:
LOCAL temp AS TEnemy
temp.x = (sx-1)*RND(1)
temp.y = RND(sy-1)
temp.w = 26
temp.h = 34
temp.life = 100
temp.speed = 1
temp.pathlength = FINDPATH(map[], temp.path[], 0.0, temp.x/mapstep, temp.y/mapstep, (sx/2)/mapstep, (sy/2)/mapstep)
IF temp.pathlength > 0
DIMPUSH enemies[], temp
ENDIF
ENDFUNCTION
FUNCTION MoveEnemies:
FOREACH temp IN enemies[]
LOCAL a = temp.path[0][0]*mapstep - temp.x
LOCAL b = temp.path[0][1]*mapstep - temp.y
LOCAL m=SQR(a*a + b*b)
IF m < 1
//reached checkpoint
IF LEN(temp.path[]) > 1
DIMDEL temp.path[], 0
ELSE
//reached objective
DELETE temp
ENDIF
ELSE
temp.dx = (a/m) * temp.speed
temp.dy = (b/m) * temp.speed"
ENDIF
INC temp.x, temp.dx
INC temp.y, temp.dy
IF temp.life <= 0 THEN DELETE temp
NEXT
ENDFUNCTION