[Lecture] Fixing Enemy Formation

I am not seeing this issue and I put the speed up to sixty, of course the sprites are moving incredibly quickly and I’m seeing multiples of the sprites mainly because the human eye doesn’t immediately stop seeing an image once it’s moved - and the human eye see’s everything in the past, a very important thing to realize in the martial arts world, and another story. But the error stipulated in the lecture doesn’t seem to occur until it hits some fantastical number, I tried 1,100. And to be perfectly honest setting in that high is a tad silly.

So, basically I have no idea what is going on? Or, how to go about fixing it. Does it have anything to do with Time.deltaTime not being a fixed value or synced to a monitor?? I need more information before I can search for a solution! I’ve got nothing.

But I’ll do what the lecture suggests, just in case it happens in the case of a slower computer.

Well, I went ahead and changed the code for no other reason than to have the code in line with the tutorial.

I guess the explanation in the lecture was right, but, I’m just not seeing the same result as the lecture shows. That is unless I put a stupidly large number in the speed like 1,100 then I get the same type of screen placement with the enemies, but, that’s just being a little bit silly.

you have to also remember you might be porting the game to a mobile device rather than a computer (web game) so in that case it might cause a problem. Maybe not so much in such a small game but it is teaching you good practises to follow in larger projects.

I vaguely remember not having the issue but doing much the same you did when i hit the section (It was about a year ago)

1 Like

Good call. I keep on forgetting about mobile devices - as I have never had a mobile phone or tablet! So, I’ll try and keep that in mind in the future…

1 Like

Did you take your code from Block Breaker where we clamp the xmin and xmax values to the edges of the screen? If you use that you won’t have this issue with his if statement.

Privacy & Terms