Had another quick look on the github. Are you calling right constructor for TAnimatedSprite?
the .Create is TObject.Create, it seems. The .Create without parameters is not written to either TAnimatedSprite or TSprite.Code:constructor TGameObject.Create(mode: TObjectMode); begin if mode=omAnim then Animations:=TAnimatedSpriteList.create;
Last edited by User137; 18-07-2013 at 03:49 PM.
*TAnimatedSpriteList. And for a while I've thought you're right, but TAnimatedSpriteList.create is defined on line 186 of Sprites.pas.
Anyway, it then would crash as soon as I'd enter TDebugState since collision is checked constantly and thus Animations is accessed constantly and it only crashes if I make both game objects touch each other.
It may be something with TAnimatedSprite class though.
Any help? I can't pinpoint the issue at all!
Where can I get al_ogg.pas file. I cant compile your project without it.
It's in Allegro.pas distribution under (allegro.pas)\addons\OGG_Vorbis\lib
//edit: Also to access debug screen press right ctrl+left shift+d on main menu.
You've got two 'isColliding' member functions as part of TGameObject but you've not overloaded them. This should give you an error in objfpc mode as far as I'm aware.
You're range checking 'CurrentAnim' but you're not range checking 'GO.CurrentAnim' which you also use. Not saying that's the issue but you should be meticulous about such things.
I'm getting the build environment setup so I can compile and debug this for you, will have you an answer asap
EDIT : You're also calling 'inherited create' from your TAnimatedSprite constructor but the parent class doesn't have it's constructor marked as virtual.
User137 is correct, you don't have 'Create' defined in the TAnimatedSprite interface but you do have it in the implementation section. As a result you're not calling that 'Create' in your Gameobject creation, instead it'll be calling whatever 'Create()' it next finds, probably TObject.
I don't mean this is an offensive manner, but I've learned some things today, I'd of said this would never compile! but there lies the executable
Edit : BAADF00D isn't just an amusing coincidence you know, look it up
Edit : You had your compiler optimization on the highest setting, this will prevent you from debugging properly.
Last edited by phibermon; 27-07-2013 at 08:14 PM.
When the moon hits your eye like a big pizza pie - that's an extinction level impact event.
Bookmarks