My game is an isometric game with an isometric view. coming up with the logic for collIsion detection hasn't been easy but I have a concept. I wanna discuss how reasonsable the concept is before I attempt it and waste time. I've stumbled on the execution of step 3.
What I planned to have are special functions that handle the relation between the floorpad and wall objects for each level. The function would be call levelone_collision() and would call the other function to do it job. Here is a rough sketch of my concept as well as some philosophy code I thought of.
//Checks collision detection between floorpad and landpad
Function 1 (floorpad, landpad)
{
//Check the collision. Return true if collision happens
}
//Uses function 1 to determine collision between character and wall object
Function 2 (floorpad, landpad, character, wallobject)
{
//a variable declared in this function
bool interaction;
//call the first function
if (Function 1 (floorpad, landpad) = true)
{
//if interaction = false the function return false
interaction = true;
}
if (interaction = true)
{
//check collision between character and wall object
}
else
{
return false;
}
}
//This function detriment the collision of a single level
function 3 (floorpad, landpad, character, wallobject)
{
for (int a = 0; a < 5: a++)
{
//call function 2
if (function 2 (floorpad[1], landpad, character, wallobject[a]) == true)
{
//When this function return true the correct force is applied to push the character back
return true;
}
}
for (int b = 6; b < 10; b++)
{
if (function 2 (floorpad[2], landpad, character, wallobject[b]) == true )
{
return true;
}
}
}
?
?