Topic: A few questions
Hey guys,
So, I created a game in which the graphics were made entirely separate from the scripts. All of the basic scripts were created inside of a test environment. They work in that area.
Now, however, when I have applied the scripts to the larger level (which has roughly 400 objects), there are certain areas that nonsensically just don't work. I'm thinking it has something to do with the amount objects inside of the level. If it is necessary to split the area up into different levels, then it is fine to do so.
Although, is there something I should be doing differently as far as object properties/code?
if (isKeyPressed('UP')) then
offset = offset < 3 and offset + 0.2 or offset
setBehaviorVariable(camera, 1, 'offset', {0, 7, 2 + offset})
end
if (isKeyPressed('DOWN')) then
offset = offset > -3 and offset - 0.2 or offset
setBehaviorVariable(camera, 1, 'offset', {0, 7, 2 + offset})
end
this area used to work fine, but for some reason it hates the down key now. When I press the down key, Maratis freezes, returns errors of certain objects not existing (as a result of it freezing), and forces me to exit the program.
I can even comment out the up key section entirely and it simply just hates the down key
Another area:
if (isKeyPressed('SPACE')) then
if (coll > 1) then
addCentralForce(player, {0, 0, 20})
changeAnimation(playerMesh, 2)
end
end
this makes the program not be able to present any kind of recognition to pressing keys and freezes, but i can still hit esc.
the game throws the error for the line if(coll >1)then