Page 1 of 1
spr_clist? How does it work?
#1
Posted 27 June 2003 - 05:23 PM
Could somebody give me a detailed explanation on how the spr_clist counter works? I've been messing with it, and can't quite seem to figure it all out... Thanks!
#2
Posted 27 June 2003 - 09:55 PM
spr_clistN is the collision list entry number N, starting at 0. Don't read past the total number of collisions reported (spr_collisions) because it'll be junk. For instance, if you do..
if c?? sprite_colliding p00 1 1
And sprite 0 here happens to be colliding with sprite 1 and that's it, and position 1 1, spr_collisions will be 1, and spr_clist0 will be 1, showing that it's colliding with sprite 1. If it collides with the background spr_clist0 will always be -1.
You might be referring to sprN_clist instead. That just invokes a collision test, for sprite N at its current position.
- Exo
if c?? sprite_colliding p00 1 1
And sprite 0 here happens to be colliding with sprite 1 and that's it, and position 1 1, spr_collisions will be 1, and spr_clist0 will be 1, showing that it's colliding with sprite 1. If it collides with the background spr_clist0 will always be -1.
You might be referring to sprN_clist instead. That just invokes a collision test, for sprite N at its current position.
- Exo
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#3
Posted 27 June 2003 - 10:20 PM
can I just read sprN_clist normally? I.E, <if "spr5_clist" = -1 "Hitbackground">
#4
Posted 27 June 2003 - 11:40 PM
.... you don't understand. Everything has a collision LIST because it can hit multiple things. sprN_clist will invoke collision, it's write only. It doesn't have an actual value; if you treat it like it does it won't result in anything good.
set "spr5_clist" 1
That will invoke a collision test for sprite 5. Then..
if "spr_clist0" = -1 "bg collision"
- Exo
set "spr5_clist" 1
That will invoke a collision test for sprite 5. Then..
if "spr_clist0" = -1 "bg collision"
- Exo
~ ex0 has a kickass battle engine, without it you sux0rz! without it you sux0rz! ~
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
"The fact that I say I've one of the best, is called honesty." -Akwende
"Megazeux is not ment to be just ASCII, it is ANSI!" - T-bone6
"I hate it when you get all exo on me." - emalkay
Exophase can what Rubi-cant.
exoware is ware ur ware is exoware
ps. not loking 4 new membrs kthx
#5
Posted 27 June 2003 - 11:43 PM
Ohhhh, I think I get it now! I'm off to keep messing with it then. Thanks again!
#6
Posted 05 December 2006 - 04:25 AM
I've always had to work around that counter. Never could get it working the way i wanted. I must be extremely slow. I think this calls for a Sprites for Dumbies publish.
EDIT:
In the latest version of Super Mario for MegaZeux, I've used a series of If sprite (sprite) commands. I know this is the wrong approach but its the only way that works best for me. I don't know why collisions are so difficult. We must be doing something wrong. In fact I know we are. But whenever I'm in IRC i never get the correct help that I'm asking for
EDIT:
In the latest version of Super Mario for MegaZeux, I've used a series of If sprite (sprite) commands. I know this is the wrong approach but its the only way that works best for me. I don't know why collisions are so difficult. We must be doing something wrong. In fact I know we are. But whenever I'm in IRC i never get the correct help that I'm asking for
This post has been edited by T-bone6: 05 December 2006 - 04:58 AM
#7
Posted 25 December 2006 - 12:41 AM
Cool thanks EXO i figured out how to make the sprite collisions work. Hopefully when I implement this into my games there wont be any complications with tons of sprites running around bumping into things using the same counters "spr_clist0".
I just used this simple bit of code for my Sprite 5 checks:
set "spr5_clist" 1
if c?? sprite_colliding p00 1 1 "check&spr_clist0&"
end
:check-1
*"Sprite 5 collided with Customblock"
end
:check0
* "Sprite 5 collided with Sprite 0"
end
:check1
* "Sprite 5 collided with Sprite 1"
end
etc
EDIT:
However, I'm still worried if this will work for my games with at the least 12 on board active sprites.
I just used this simple bit of code for my Sprite 5 checks:
set "spr5_clist" 1
if c?? sprite_colliding p00 1 1 "check&spr_clist0&"
end
:check-1
*"Sprite 5 collided with Customblock"
end
:check0
* "Sprite 5 collided with Sprite 0"
end
:check1
* "Sprite 5 collided with Sprite 1"
end
etc
EDIT:
However, I'm still worried if this will work for my games with at the least 12 on board active sprites.
This post has been edited by T-bone6: 25 December 2006 - 01:07 AM
Share this topic:
Page 1 of 1

Help






