Sub Timer1_Tick
'Manually change the current frame.
sprite.CurrentFrame = (sprite.CurrentFrame + 1) Mod 8 + 8 * direction
If sprite.IntersectsPoint(100,100) Then form1.Text = sprite.X & " " & sprite.Y
gw.Tick
End Sub
Yes.Also can I drop the = True?
... I am not trying to use an edge. I am trying to choose a point anywhere on screen, send a sprite travelling through it and expect an event when it arrives at it.
To do this I expected to use If sprite.IntersectsPoint(156,76)= but received the unexpected results mentioned above.
Why not post the code that doesn't work then we can see what the problem is?If I have not made myself clear please tell me.
I am afraid not. I meant post the actual sbp file so we can run it and see exactly what is happening (or not!).Have I still not made it clear?Thank you.
It will be I'm sure.it is fine if it is consistent (which I don't know)
The actual pixel I think, check it yourself with a stationary sprite at 0,0 and 1,1.When you say the upper left corner do you mean the actual pixel on the corner or a position one removed from the corner i.e. outside the sprite?
It may be observed that by adjusting these numbers, the sprite is then out of position when it turns the corner.
The problem is that the starting X and Y co-ordinates for the sprite are for the upper left corner. It also appears that the intersect test is a > or < rather than an equals test. So for your 15 x 15 sprite starting at Y = 76 the values that will produce an intersection are between Y = (76 + 1) = 77 and Y = (76 + 15 -1) = 90.
Yes, I mean the collision test and no, I don't know why.Sorry to bring this up again but I am not quite clear. When you say < and > do you mean the internal B4PPC test? If so, can you say why it is not =
I can't really offer any further enlightenment. Just play with various settings and see how it behaves.If the corner pixel of the sprite is actually on Y=76 and moves in direction zero (X changing not Y) then the pixel at the other end of the sprite block (15 x 15 hence +15) will travel along coord 76 and pass over each X pixel at Y76 Why must I check one pixel down the block at Y 77?
This seems to suggest that the edge pixels of a sprite (all of them round the block) cannot be tested for position. And what about a single pixel sprite (if you could see it). Any further enlightenment will be appreciated.
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?