Re: OpenGL fade effect
Posted: Mon Sep 13, 2010 10:18 pm
Its in the code I posted earlier. It looks like this.
Code: Select all
for (int i = 0; i < TILE_SOLID_COUNT; i++) {
if (IsCollision(tileRect[i], playerRect) == true) {
collision = true;
if (i == 33) { //Collision with the warp
x = 303; //Set to center
y = 223; //Set to center
alpha = 0.0f; //Set the alpha to zero
fading = true; //Set the fading to true
}
if (movedX == true) {
if (movedRight == true) {
x-=5;
}
else {
x+=5;
}
}
//Collision response below
if (movedY == true) {
if (movedUp == true) {
y+=5;
}
else {
y-=5;
}
}
}
if (fading) {
break;
}
}