About Store Forum Documentation Contact



Post Reply 
Why the program hangs?
Author Message
Babulesnik Offline
Member

Post: #1
Why the program hangs?
Code:
if(Kb.b(KB_SPACE))
   {
     Vec Pos[4];
     Pos[0]=(29.641,17,-2.182);Pos[1]=(29.641,17,-1.574);Pos[2]=(29.021,17,-2.156);Pos[3]=(29.021,17,-1.552);Pos[4]=(28.378,17,-1.870);
       FREP(5)
       {
ObjItem[i].matrix(Matrix(ObjItem[i].matrix()).rotateXY(Random.f(45),Random.f(45)));
ObjItem[i].pos(Pos[i]);ObjItem[i].actor.active(true);ObjItem[i].actor.addImpulse(Vec(0,-2,0));
       }
}
04-22-2011 01:25 PM
Find all posts by this user Quote this message in a reply
Dynad Offline
Member

Post: #2
RE: Why the program hangs?
If you create a array with Pos[4] means you want to create 4 memory spaces/elements... and you want to access 5 elements which is of course not possible and looping 5 times with a array the size of 4 doesn't work very well either.. wink

There is always evil somewhere, you just have to look for it properly.
04-28-2011 04:10 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Post Reply