My game needs gravity.
Lets just say that I did y+=1;
The problem occurs when I want to collide my object with an line or a platform.
SOMEHOW object get stuck in Platform/Line..
I debugged it a lot of times and there is no any actual error.
It is just a glich.
After years of trying to solve it I managed.
When you put code in UpdateModel() > it runs properly.
When you put code in Your own function (That you run trough UpdateModel() ) > It runs differently.
Glich was shown in ones of Chilli's tutorials.
https://www.youtube.com/watch?v=xWLcp_yOpww at 24:01
(In that video is shown how my glich behave).
So why is this:
Code: Select all
UpdateModel()
{
If (y>=0)
y= 0+1 //y is global int defined at Game.h/User variables
}
Code: Select all
UpdateModel()
{
checker(ScreenHeight);
}
void checker(int Var)
{
If (y>=0)
y= Var+1 //y is global int defined at Game.h/User variables
}