? Weirdness with SPHOME (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Weirdness with SPHOME

  • #1 ✎ 14 benjymous Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Day Person I like the warm sunshine and wake up early! Express Yourself Reading I like to read books! Hobbies Can anyone else test/confirm this for me that I'm not doing anything stupid? If you use SPHOME to set the offset on a sprite, then use SPCHR to change the sprite image, it resets the offset (which doesn't appear to be documented) This means if you use SPHOME to, say, set a character sprite offset at their feet, the animate using SPCHR, you need to remember to set SPHOME again each frame. Posted
  • #2 ✎ 188 Perska Summer 2016 Contest Winner I won the SmileBASICSource Summer 2016 Contest! Programming Contest Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength RNG Hidden Easter Eggs The sprite definitions have data for SPHOME, meaning you'd have to adjust the definitions with SPDEF. Or, you can give SPCHR the offsets of the texture (SPCHR ID, X offset, Y offset, width, height) Posted
  • #3 ✎ 83 niconii Video Games I like to play video games! Hobbies Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Drawing I like to draw! Hobbies For the record, SB already comes with sprite definitions with SPHOME at the feet. Just add 2048 to the definition number. Posted
  • #4 ✎ 14 benjymous Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Day Person I like the warm sunshine and wake up early! Express Yourself Reading I like to read books! Hobbies
    For the record, SB already comes with sprite definitions with SPHOME at the feet. Just add 2048 to the definition number.
    Ahh, thanks - I totally managed to miss that On a semi-related issue, is there any way to change the sprite draw order so that they draw ordered by Y position, rather than management order?
    Posted
  • #5 ✎ 9 hanzo
    For the record, SB already comes with sprite definitions with SPHOME at the feet. Just add 2048 to the definition number.
    Ahh, thanks - I totally managed to miss that On a semi-related issue, is there any way to change the sprite draw order so that they draw ordered by Y position, rather than management order?
    Does it match your purpose to gear Z position to Y position?
    Posted
  • #6 ✎ 14 benjymous Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Day Person I like the warm sunshine and wake up early! Express Yourself Reading I like to read books! Hobbies Yes, that mostly works - especially if I set the screen to 2D. WIth 3D on, I notice a weirdness in that not all sprites at the same Y value seem to have the same depth (i.e. some sprites seem to stick out further than others). That might be a result of me using floating point values, I guess - so a sprite at Y:100.1 and Y:100.9 would have the same vertical screen position, but may end up with Z values that put them on different depth layers when it hits the 3D hardware. Posted
  • #7 ✎ 9 hanzo I have tried building "Sprite Management Number Swapping Algorithm" to reduce the weirdness you have felt. Could you download V3EKQXN1 and refer to EX_SPPRIO in the downloaded folder? Please download it asap because I'll keep it on the cloud server temporarily. Posted
  • #8 ✎ 14 benjymous Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Day Person I like the warm sunshine and wake up early! Express Yourself Reading I like to read books! Hobbies Got it - thanks! Ooh, clever, so you're detecting collision and switching based on Y - that's pretty nifty. Any idea how much slowdown that causes if you've got lots of sprites on the go? Posted
  • #9 ✎ 9 hanzo I guess that it depends on frequency of sprite collision (density of sprite crowd). Normally, the probability that sprite collision will occur must be low. (In my program, all sprites share a X position.) By the way, I've built EX_SPPRIO2, a little bit improved from EX_SPPRIO. Could you download N3234PCP? Posted
  • #10 ✎ 9 hanzo I've modified the key. The new one is XELE38HE. Posted