![]() |
|
|||||||
| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| Questions & Help Needed Post any question regarding Basic4ppc. |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Sorry, I misunderstood.
The file and support is attached. It is the original Sprite demo with unnecessary??? lines removed so that I didn't get confused and could analyze the simplest situation. A breakpoint was placed on line 33 and watches for cw.X and cw.direction. I am sure it is something stupid but I cannot understand why changing the number as mentioned in earlier post, had the effect it did. Thank you if you are able and willing to assist. |
|
|||
|
Thank you for your assistance agraham. I understand what you are driving at and it is fine if it is consistent (which I don't know).
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? I can understand > or < when the sprite is moving in that direction so that while moving in X it is OK but if it is not moving in Y direction then... As an observation it would be useful if the help file reflected this important aspect. Any further observation will be welcome while I experiment. Thank you again. [Edit] It may be observed that by adjusting these numbers, the sprite is then out of position when it turns the corner. [Further Edit] If for 176 one uses 174 (not 175) the sprite oddly is in position when turning in the grid. I don't quite see why unless it is a 'fence posts' problem in my calculations. Last edited by enonod : 05-01-2008 at 07:16 PM. |
|
||||
|
It will be I'm sure.
Quote:
Quote:
![]() |
|
|||
|
Thank you for getting me going agraham. The query at the end of your post...
the turn point I originally used 176,76 would have turned the sprite to travel down the grid exactly between the lines. By having to adjust the number it runs down on the line. By changing the number to X=174 to turn the sprite travels between the lines. The line is at 175 and the sprite should be at 176 to not overlap it. That was all... I can't see why. No answer required, I'll get there in the end. |
|
|||
|
Quote:
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 [EDIT] and what about a single pixel sprite (if you could see it) Any further enlightenment will be appreciated. Last edited by enonod : 05-27-2008 at 09:54 AM. Reason: Another thought |
|
||||
|
Quote:
Quote:
|
|
|||
|
Thank you agraham, I have done that now and with the help of the attached diagram I can illustrate what actually happens in practice. This may be of interest to anyone using this Intersect command, because it 'seems' to have a problem.
I have attached a program illustrating the principle (larger grid to give time to watch) and in the array of numbers have use +1 to highlight where the problem occurs. (Run on destop.) The green sprite moves one pixel at a time until it is detected, then changes direction 90 degrees and so will travel clockwise. It starts at x=1 y=1 and progresses x=2 y=1, x=3 y=1 etc. I attempt to detect its arrival using the Red points such that when the direction changes the sprite is always between the large grid lines. It does seem to me odd that an equality test is not done instead of > & < because it can clearly be seen from the diagram that a single pixel horizontal line used as a sprite say x=1 y=1 to x=5 y=1 won't work (not tested) because it doesn't hit the blue. The intersect points actually required to make this work are shown Blue. Note that one of the expected Reds works anyway. If the red points are used then the sprite does not always travel between the grid lines it is often out by one but of course not always. If you find a flaw in this please let me know. |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Newbie: animation | texaspoker11 | Questions & Help Needed | 3 | 11-05-2008 06:43 PM |
| Sprite Z Priority | fjsantos | Questions & Help Needed | 4 | 07-20-2008 06:43 PM |
| Newbie Question | Stevenator65 | Questions & Help Needed | 9 | 05-30-2008 09:53 PM |
| Newbie Questions | Bruno | Questions & Help Needed | 2 | 05-05-2008 07:45 PM |
| Newbie questions | stratus | Questions & Help Needed | 2 | 11-13-2007 02:21 PM |