阅读背景:

函数仅适用于第一个衍生的精灵,而不适用于另一个

来源:互联网 

Im new to programming and still learning much. I have just encountered a problem. The part I have a problem with is the sharkWall() function that makes the "SHARKNODE"-sprite turn around and head the opposite direction whenever it reaches the end of the screen in each way. the "SHARKNODES" are spawned every 0.75sec with a timer in Y-direction. And here is the problem. The sharkWall() function only seem to be working on the first spawned "SHARKNODE"-sprite and not the other ones that gets spawned higher up on the Y-axis. Worth to mention is that the first spawned sprite is the only sprite that is visible on the screen until the player gets higher upp on the Y-axis and the other "SHARKNODE"-sprites appear on the screen. And of course, what i want is to make the sharkWall() function to work on all "SHARKNODE"-sprites. Anyone who has an idea on what to do here and could explain? Thanks in advance. Im new to programming and still learning much.




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: