Posts: 122
Threads: 6
Joined: Feb 2002
Personally I prefer to have all the y-sorted (that's what I call the 3d effect, as that is what it is anyways) as objects.
Then you can just sort the objects by their vertical position (y) and draw them in that order.
Posts: 3,288
Threads: 167
Joined: Nov 2001
New game Joakim? RE: avatar.
Posts: 122
Threads: 6
Joined: Feb 2002
LOL Relsoft, either you were joking or the picture is too small to see what it is - goto http://lithium.zext.net/a.html to see it in it's right size
Posts: 4,307
Threads: 63
Joined: May 2003
Hehe...I used to be a bio student so I understood it rightaway =D
Posts: 3,288
Threads: 167
Joined: Nov 2001
Hahahaha!!! I wasn't joking. Now the Joke's on me. LOL
Didn't Notice.
Posts: 49
Threads: 17
Joined: Jul 2003
Code: SUB drawcharobj
FOR i = 0 TO npcs
SnpcY(i) = npcY(i)
Inpc(i) = i
NEXT i
FOR i = npcs + 1 TO npcs + nmys
SnpcY(i) = nmyY(i - npcs)
Inpc(i) = i
NEXT i
FOR d = 0 TO npcs + nmys
FOR i = 0 TO npcs + nmys
IF SnpcY(i) > SnpcY(i + 1) THEN SWAP t, SnpcY(i + 1): SWAP tt, Inpc(i + 1): SWAP SnpcY(i + 1), SnpcY(i): SWAP Inpc(i + 1), Inpc(i): SWAP SnpcY(i), t: SWAP Inpc(i), tt
NEXT i
NEXT d
FOR i = 0 TO npcs + nmys
n = Inpc(i)
IF n <= npcs THEN
IF npcIngame(n) = 1 THEN
xpos = npcX(n) - cameraX
ypos = npcY(n) - cameraY
IF npcSpr(n) <= 3 THEN DQBput 1, xpos - 10, ypos, VARSEG(shadow1%(0)), VARPTR(shadow1%(0))
IF npcSpr(n) = 4 THEN DQBput 1, xpos - 10, ypos, VARSEG(shadow2%(0)), VARPTR(shadow2%(0))
IF npcSpr(n) = 0 THEN DQBput 1, xpos - 10, ypos - 30, VARSEG(hero%((nframe(n) + nadd(n)) * 352)), VARPTR(hero%((nframe(n) + nadd(n)) * 352))
IF npcSpr(n) = 1 THEN DQBput 1, xpos - 10, ypos - 30, VARSEG(npc1%((nframe(n) + nadd(n)) * 352)), VARPTR(npc1%((nframe(n) + nadd(n)) * 352))
IF npcSpr(n) = 2 THEN DQBput 1, xpos - 10, ypos - 30, VARSEG(npc2%((nframe(n) + nadd(n)) * 352)), VARPTR(npc2%((nframe(n) + nadd(n)) * 352))
IF npcSpr(n) = 3 THEN DQBput 1, xpos - 10, ypos - 30, VARSEG(npc3%((nframe(n) + nadd(n)) * 352)), VARPTR(npc3%((nframe(n) + nadd(n)) * 352))
IF npcSpr(n) = 4 THEN DQBput 1, xpos - 10, ypos - 30, VARSEG(orb%((nframe(oc) + nadd(oc)) * 202)), VARPTR(orb%((nframe(oc) + nadd(oc)) * 202))
IF npcSpr(n) = 5 THEN DQBput 1, xpos - 25, ypos - 25, VARSEG(vec1%(vadd * 677)), VARPTR(vec1%(vadd * 677))
IF numb = 1 THEN DQBprint 1, STR$(n), xpos - 20, ypos - 30, 32
xtile = INT(npcX(n) / 20)
ytile = INT(npcY(n) / 20)
IF xtile < 1 THEN xtile = 1
IF xtile > mapx THEN xtile = mapx - 1
IF ytile < 1 THEN ytile = 1
IF ytile > mapy THEN ytile = mapy - 1
xpos = cameraX MOD 20'moet afhankelijk van npc worden gemaakt i.p.v. scherm
ypos = cameraY MOD 20
x = npcX(n) - cameraX
y = npcY(n) - cameraY
x = INT(x / 20)
y = INT(y / 20)
IF mapc(xtile, ytile) > 0 THEN
DQBput 1, x * 20 - xpos, y * 20 - ypos, VARSEG(tile%(mapc(xtile, ytile) * 202)), VARPTR(tile%(mapc(xtile, ytile) * 202))
IF mapc(xtile - 1, ytile) > 0 THEN DQBput 1, x * 20 - xpos - 20, y * 20 - ypos, VARSEG(tile%(mapc(xtile - 1, ytile) * 202)), VARPTR(tile%(mapc(xtile - 1, ytile) * 202))
IF mapc(xtile + 1, ytile) > 0 THEN DQBput 1, x * 20 - xpos + 20, y * 20 - ypos, VARSEG(tile%(mapc(xtile + 1, ytile) * 202)), VARPTR(tile%(mapc(xtile + 1, ytile) * 202))
END IF
IF mapc(xtile, ytile + 1) > 0 THEN
DQBput 1, x * 20 - xpos, y * 20 - ypos + 20, VARSEG(tile%(mapc(xtile, ytile + 1) * 202)), VARPTR(tile%(mapc(xtile, ytile + 1) * 202))
IF mapc(xtile - 1, ytile + 1) > 0 THEN DQBput 1, x * 20 - xpos - 20, y * 20 - ypos + 20, VARSEG(tile%(mapc(xtile - 1, ytile + 1) * 202)), VARPTR(tile%(mapc(xtile - 1, ytile + 1) * 202))
IF mapc(xtile + 1, ytile + 1) > 0 THEN DQBput 1, x * 20 - xpos + 20, y * 20 - ypos + 20, VARSEG(tile%(mapc(xtile + 1, ytile + 1) * 202)), VARPTR(tile%(mapc(xtile + 1, ytile + 1) * 202))
END IF
END IF
END IF
IF n > npcs THEN
IF nmyingame(n - npcs) = 1 THEN
xpos = nmyX(n - npcs) - cameraX
ypos = nmyY(n - npcs) - cameraY
DQBput 1, xpos - 10, ypos, VARSEG(shadow1%(0)), VARPTR(shadow1%(0))
IF nmySpr(n - npcs) = 1 THEN DQBput 1, xpos - 16, ypos - 24, VARSEG(enemy1%((nmyframe(n - npcs) + nmyadd(n - npcs)) * 514)), VARPTR(enemy1%((nmyframe(n - npcs) + nmyadd(n - npcs)) * 514))
END IF
END IF
NEXT i
END SUB
Posts: 49
Threads: 17
Joined: Jul 2003
hadn't the time to comment it but if you got any question and you've read the msg's before the code just ask me...
Posts: 49
Threads: 17
Joined: Jul 2003
could anyone read my question and help me with the code plz?
the question is in the first messages...
thnx
|