Why doesn't this work

BlitzMax Forums/BlitzMax Beginners Area/Why doesn't this work

SculptureOfSoul(Posted 2007) [#1]
edit: nevermind, stupid mistake.


Dreamora(Posted 2007) [#2]
No it shouldn't

You never pass the object itself when drawing the collision with collideimage.

you need to pass the object as well, otherwise the only thing you get back is the image.


SculptureOfSoul(Posted 2007) [#3]
haha, thanks Dream. After a few minutes of pondering it hit me that I was only getting a TImage back. I've now added the object itself to the original CollideImage call, and all is working.

Thanks :D.


dmaz(Posted 2007) [#4]
please don't edit the question away.... doing so destroys the context that could otherwise help other people.


TaskMaster(Posted 2007) [#5]
Yes, I agree with dmaz.

SculptureOfSoul, you have done that in more than one thread today. Please leave the info there, so other people can learn from the discussion.


H&K(Posted 2007) [#6]
Though, putting EDIT: and then the answer to the problem you had, is also useful. That is, dont remove the question, just add the answer.

In this case the answer would have been of limeted value, what with the thread title being so vague, and as you said, just a simple error.

(Thou, I get the impression that this time you had edited the question before you saw dreams answer)


SculptureOfSoul(Posted 2007) [#7]
I did actually edit the question before I saw Dreams answer, and it was a silly stupid mistake so I didn't think it would be of much value to anyone.

Anyways, I was calling CollideImage() on the image field of a TSprite type, and then tried casting the result of CollideImage() back to the TSprite type and reading some fields from, but was getting a MAV error. Turns out, I was forgetting to add the TSprite object to the original call to CollideImage as the object that should be returned, so instead I was just getting a TImage back and trying to treat it as a TSprite.



SculptureOfSoul, you have done that in more than one thread today.


Well, the other thread I edited because I was offering a suggestion to Grey Aliens problem, but it turned out that he figured out he broke his code elsewhere, so there was no need to clutter up the thread with the suggestion and test code I had posted for a problem that turned out not to exist.