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

2019/6/18

Tron Game, problem with spawning "line"

_Tobi.X _Tobi.X

2019/6/18

#
I'm currently programming a pretty simple Tron game. The problem I'm having now is, that when I spawn the "Line" (That's like coming out at the end of the cycle) and try to adjust the x and y location (with the SmoothMover class) of the spawn when the cycle is turned, the line suddenly interrupts and starts continueing after probably 1.5 seconds. I hope this describes my problem well enough. Cheers!
danpost danpost

2019/6/18

#
_Tobi.X wrote...
I hope this describes my problem well enough.
The description seems pretty good; however, it is tough to correct codes that cannot be seen.
danpost danpost

2019/6/18

#
_Tobi.X wrote...
I spawn the "Line" ... and try to adjust the x and y location (with the SmoothMover class) of the spawn
I cannot see a need for the SmoothMover class for a "Line" object. It will not be moving. I suggest just placing a new "Line" object at the cycle's location before it moves and move just enough to not have the center of the cycle image over that new "Line" object. That way you can use the getObjectsAtOffset(0, 0, << "Line" class name +".class" >>) method to check for collisions.
You need to login to post a reply.