It looks like you're new here. If you want to get involved, click one of these buttons!
[2011-03-11 11:09:23] <ANIM> (orxAnimSet_ComputeAnim() - Users/adamtomecek/Programování/The Game/orx_svn/code/build/mac/xcode/../../../src/anim/orxAnimSet.c:2289) Couldn't compute next animation.
[2011-03-11 11:09:23] <ANIM> (orxAnimPointer_GetCurrentAnimHandle() - Users/adamtomecek/Programování/The Game/orx_svn/code/build/mac/xcode/../../../src/anim/orxAnimPointer.c:696) Anim pointer does not have a current anim.
[2011-03-11 11:09:23] <ANIM> (orxAnimPointer_Compute() - Users/adamtomecek/Programování/The Game/orx_svn/code/build/mac/xcode/../../../src/anim/orxAnimPointer.c:333) Cannot process animation pointer without a current animation.
[2011-03-11 11:09:23] <OBJECT> (orxObject_UpdateAll() - Users/adamtomecek/Programování/The Game/orx_svn/code/build/mac/xcode/../../../src/object/orxObject.c:296) Failed to update structure #0 for object <Krtek>.
[2011-03-11 11:09:23] <ANIM> (orxAnimPointer_GetCurrentAnimHandle() - Users/adamtomecek/Programování/The Game/orx_svn/code/build/mac/xcode/../../../src/anim/orxAnimPointer.c:696) Anim pointer does not have a current anim.
[2011-03-11 11:09:23] <ANIM> (orxAnimPointer_Compute() - Users/adamtomecek/Programování/The Game/orx_svn/code/build/mac/xcode/../../../src/anim/orxAnimPointer.c:333) Cannot process animation pointer without a current animation.
[2011-03-11 11:09:23] <OBJECT> (orxObject_UpdateAll() - Users/adamtomecek/Programování/The Game/orx_svn/code/build/mac/xcode/../../../src/object/orxObject.c:296) Failed to update structure #0 for object <Krtek>.
Comments
For the first transition (apear->idle loop), it will happen automatically if setup correctly in config. As for the second animation, why creating a new object with an animation instead of using the current one?
You don't have to set the first animation, orx will take the first one defined in the animation list when an object is created.
You shouldn't need any clock for handling animation. In the tutorial we simply register an update function on the core clock that will handle the input and change the animation accordingly.
The log tells you that there isn't a current animation. That means that either you requested an animation he cannot play/reach or that the animation graph isn't set correctly in data.
You need something like this:
In data:
In code:
And that should be all. You can also add some orxFX to have a fadein-fadeout in the same manner (it's automatic on creation if you set it correctly in data and on deletion you simply call orxObject_AddFX(MyObject, "DisappearFX");
Let me know if you still have a problem.
EDIT: It might not have been clear, but when using orxObject_SetLifeTime() you don't need to call orxObject_Delete(). If the object is already getting deleted, that won't work. In this case I would simply set a timer for every object when it's created (orxClock_AddGlobalTimer()) and in the function called by the timer, you can then play the anim and call SetLifeTime(). If the object needs to be removed before the end of the timer, you can remove the timer (orxClock_RemoveGlobalTimer()).
And for that question why creating object again. I'm "listening" to mouse click and if user clicks on object created by spawner, I delete object and add score. So if object will be in state "disappearing" I don't want it to be count as regular object and I don't know any other way how to do it
I just wonder how to delete global timer? If I don't do it and delete object before timer does, game just crashes after while, which I expect.
But if I want to delete global timer, I simply don't know how. I don't get why remove function got delay and callback so I don't know how to use it. I tried something like this
But game just crashes in function which is deleting objects automatically (while getting objects name - object is tested not to be orxNULL) after while if object is clicked and deleted.
Ah, I see! The easiest way would then be to create your own struct/class for those objects in which you can maintain a bool that say if the object can be clicked or not. You can then link this struct to an orxOBJECT with orxObject_SetUserData().
Another, more dirty way to do it would be to pull the non clickable object further in the foreground by decreasing its Z coordinate value when clicked and make sure you call the picking function with a Z greater than this value (this way those foreground objects would become automatically non-pickable).
The parameters sent to the remove timer function are simply to find which one you want to remove. If you set the context, only the timer that has the same context will be removed, otherwise all the timers that use the same callback you gave will be removed.
Same for the delay, it's only to find the right occurence. If I remember correctly, passing -1 would then ignore the delay parameter and remove all the timers that match the callback/ context. Let me know if this still sound obscure to you.
I'm trying to compile it on WIndows too, so my friend who does graphics for me could see it, but I got crash right after running it in orxAnimSet_CreateFromConfig.
Can this be some problem of latest SVN version? Because it just crashes probably without using any of my code
Are you running in release or debug? mingw or visual studio? My guess is there's something unexpected by orx in the config files.
If you can't find it, just send me a zip of your current work and I'll give it a look tonight.