This site requires JavaScript, please enable it in your browser!
Greenfoot back
SushiLlama
SushiLlama wrote ...

2019/11/10

Reflection law calculate new direction (Tank Game)

1
2
3
SushiLlama SushiLlama

2019/11/15

#
Tried all of them. It made the amount of disappearing shells even larger, im afraid.
danpost danpost

2019/11/15

#
SushiLlama wrote...
Tried all of them. It made the amount of disappearing shells even larger, im afraid.
Okay ... try switching lines 7 & 8 and lines 15 and 16.
SushiLlama SushiLlama

2019/11/15

#
Tried all of them. It made the amount of disappearing shells even larger, im afraid.
danpost wrote...
See if a larger value than 99 (and -99) will do the trick. Try 100, 150, 199 (I would not think more than 199 would be needed. The initial 99 was for the fact that the QActor is not placed at its Q-location (cannot be placed between pixels on the screen). The additional amount I am suggesting now is for the change in rotation of the actor (the center of the image along an even sized dimension is a half pixel off from where the actor is actually placed on the screen). These values are on the two lines I just added (two values on each line).
Works like a charm! But it seems to skip frames, e.g. the shell moves to quickly. After the bounce the back of the shell should be one just at the wall, right? But the shell seems to move further, if you get what i mean. Like after the bounce the shell should be touching the wall with the back (before the bounce it was the front) and then in the next frame begin to move away from the wall. This step is just skipped, so it looks like the shell is teleporting. I hope my bad explanation is enough to get my point. But Jesus am i happy that it works now! Ty
You need to login to post a reply.
1
2
3