AxlLind / Strive

Infinite jumper mobile game created in Unity.
6 stars 1 forks source link

Make use of queues and add blinking platforms #108

Closed Jontpan closed 7 years ago

Jontpan commented 7 years ago

When testing, use basicPlatformScheme(30, 40, 5, 15, 10);

96

Jontpan commented 7 years ago

Yep, I outlined these problems in the commit message. While I have some idea of how to fix it, I hoped that it would never occur... :P

sigh

I'll get on it.

AxlLind commented 7 years ago

My bad, didn't read the commit message. Found a problem with the prefabqueue implementation, though. It keeps adding stuff to the queue even when there are stuff in the queue. This would be ok if we only added one prefab and took one out every time but with the flip and blinker platform we add more than one prefab and only take out one.

This means the queue increases in length quickly. It always increases and never decreases. With some quick testing it was up to 50 elements at y = 200.

Jontpan commented 7 years ago

I am aware of this but figured it wouldn't be too bad. But we could honestly just clear the queue at every difficulty increase.

AxlLind commented 7 years ago

Cant we just add an if statement around the choosePlatform()?

if (prefabQueue.Count == 0) 
{
    choosePlatform();
}

That way we don't add stuff to the queue unless we need to.

Jontpan commented 7 years ago

Lot better.