hey. basically, i'm adding a function that will make it easy for me to place props in my level.
i know its messy and some stuff doesn't make sense yet..
basically it works like this: i press 'M' and it enters "move mode". then i click the entity i want selected and then move it with the number keys. then press 'M' again to exit move mode. the problem comes in when i exit move mode. when i do that, the entity in question makes a jump to some random other place between where it was originally and where it is afterwards, but then goes back to the correct position. (its only for a split second). i thought it was a problem with my buffer swapping, but now i don't think so. could it be because i'm using captureworld and renderworld tween in my main code for frame limiting?
Function moveProp() RenderWorld Text 100,100,"move mode enabled" Flip Repeat If MouseHit(1) Then picked=CameraPick(mainCam,MouseX(),MouseY()) If KeyHit(keyM) Then Return updatePlayer() UpdateWorld RenderWorld Text 100,100,"move mode enabled" Flip Until picked entitypicked=PickedEntity() movePropDone=0 For newProp.prop=Each prop If newprop\mesh=entitypicked Repeat If KeyDown(key1) Then TranslateEntity newprop\mesh,0,1,0 If KeyDown(key2) Then TranslateEntity newprop\mesh,0,-1,0 If KeyDown(key3) Then TranslateEntity newprop\mesh,1,0,0 If KeyDown(key4) Then TranslateEntity newprop\mesh,-1,0,0 If KeyDown(key5) Then TranslateEntity newprop\mesh,0,0,1 If KeyDown(key6) Then TranslateEntity newprop\mesh,0,0,-1 If KeyHit(keyM) Then movePropDone=1 updatePlayer() UpdateWorld RenderWorld Text 100,100,"move mode enabled" Flip Until movePropDone EndIf Next Flip FlushKeys() End Function
i know its messy and some stuff doesn't make sense yet..
basically it works like this: i press 'M' and it enters "move mode". then i click the entity i want selected and then move it with the number keys. then press 'M' again to exit move mode. the problem comes in when i exit move mode. when i do that, the entity in question makes a jump to some random other place between where it was originally and where it is afterwards, but then goes back to the correct position. (its only for a split second). i thought it was a problem with my buffer swapping, but now i don't think so. could it be because i'm using captureworld and renderworld tween in my main code for frame limiting?