Sign in to follow this  

Wierd Glitch

This topic is 4358 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

In my tiling engine i made it have a camera... anyways when i walk into the wall it will stop me.. for example I hit the north wall now once i hit the north wall i can move south and east but when i try to move west i cant go past the place i hit north... do you get it? i dont understand what could possibly be doing this... and the wierder thing is that if i move the camera... it will allow me to move again!

Share this post


Link to post
Share on other sites
as i understand it your game uses a 3D tile based world with walls where you want to navigate the camera within the walls. And when you hit the north wall the program somehow places an invisible wall at your left along your world that doesn't disappear, right?

what does the code do when you detect a collision? are there any flags set at collision you forget to reset? don't you confuse the north and east limit of a tile in your detection system?

Share this post


Link to post
Share on other sites
my bad its a 2d game... my walkable is basic and it looks liek this

bool Walkable()
{
int Column = xPos / 32;
int Row = yPos / 32;
int Column2 = (xPos + Wizzy_Width)/32;
int Row2 = (yPos + Wizzy_Height) / 32;




if(Map[Row][Column] == 1 || Map[Row2][Column2] == 1)
{


return false;
}
else
{
return true;
}
}


then... i just do if(Walkable() == true)

blah blah... but yes when i hit the north wall, say at y position 200, when i try to move left, i cant go past 200 pixels no matter what i do.. untill i move the camera. i dont know its wierd... if you want to see the actual program you could aim me at willthiswork89 and i could help you help me.

Share this post


Link to post
Share on other sites
You haven't really posted enough code to go by, but guessing at what's there I would say you're either not setting the values in your array properly somewhere, or you're indexing it/checking it improperly. It's difficult to help more without knowing what xPos/yPos/wizzy_width/wizzy_height, 32, your array, etc represent.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
xpos and y pos is the x and y position of the character, wizzy width would be 32 because the character is 32 wide, my array i did a for loop, if(row == 0)
map[row][col] = 1; if its one then its a rock... it checks by taking the x and y of the character and then deviding it by 32 to see what tile hes on...

but i know that is works because it stops me... it just stops me after im stopped at that y position as if theres an invisible wall.. ever thought if i move the map i can then move past it... im checking the walkable like this

if(Moveable() != false)
{
xPos += Wizzy_Width(32)/4;
}

Share this post


Link to post
Share on other sites

This topic is 4358 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this