Hello, I am currently making a small Doodle Jump clone but I ran into a problem.
I created a class that just takes care of the platforms(it extends another class) on the screen and their interaction with the character. Here is how my platform class update method looks like:
void update() {
for (int i = 0; i < m_Platforms.size(); i++) {
Platform platform = m_Platforms.get(i);
//If the character reaches half of the screen and is falling
if (platform.updatePosY(m_Doodler) && m_Doodler.velocity.y<0) {
//PLATFORMS SCROLLING
//if the character reaches 3/4 of the screen the platforms double their velocity
if (platform.doubleSpeed(m_Doodler)) {
platform.getPos().y += m_Doodler.velocity.y*(-2);
} else {
platform.getPos().y += m_Doodler.velocity.y*(-1);
}
score++;
}
//If the platforms reach the bottom they are removed
if (platform.checkBottom()) {
println("g");
//UPDATING PLATFORMS ON SCREEN
m_Platforms.remove(i);
}
}
}
The issue is that the more the character jumps on the platform the more my velocity keeps increasing, the score increases way too fast as well, and the platforms are not even removed from the screen.
Any idea on how to fix this?