I was working on my second game ever...an adventure game somewhat like Zelda 64, after my A.I technique proved positive i came across a problem so odd...that it makes no sense...in the following code AIT is AI type (don't worry about it...) this is the first section of the code...I do a for loop to see if object AIP (in this case pbject 1) is colliding with he bullets (objects 101-110). The object only dies when it collides with bullet 101... Memblock Byte(1,AIP) (AIP=1) is whenther the object is dead or not (1= if alive, 0 if dead)...The memblock byte 1,2 thingy is to tell me which bullet killed it... the odd part is that I remved all of this code and made a test programm to see whether the is colliding (or hitting) an object in the first place and it responds to all those pbjects...but not in this for-loop...perhaps something I did?
AI:
If AIT=1
For z=101 to 110
If Object Collision(AIP,z)=1 And memblock byte(1,AIP)=1
Write Memblock Byte 1,AIP,0
Write Memblock Byte 1,2,z
Set Object Speed AIP,50
Play Object AIP,400,440
endif
If Object Hit(AIP,z)=1 And memblock byte(1,AIP)=1
Write Memblock Byte 1,AIP,0
Write Memblock Byte 1,2,z
Set Object Speed AIP,50
Play Object AIP,400,440
endif
next z
Here is the code without the [ c o d e ] thingy...it sometimes messes it up
AI:
If AIT=1
For z=101 to 110
If Object Collision(AIP,z)=1 And memblock byte(1,AIP)=1
Write Memblock Byte 1,AIP,0
Write Memblock Byte 1,2,z
Set Object Speed AIP,50
Play Object AIP,400,440
endif
If Object Hit(AIP,z)=1 And memblock byte(1,AIP)=1
Write Memblock Byte 1,AIP,0
Write Memblock Byte 1,2,z
Set Object Speed AIP,50
Play Object AIP,400,440
endif
next z
PLEASE HELP? any Qs that might lead you to solving it?
If life gives you a lemon, shove it up a water gun and squirt it into someone's eyes!