Scroll - how to delete an object

edited July 2013 in Help request
how do i properly delete an object?

im trying this
orxSTATUS OrxScroll::Run ()
{
    orxSTATUS result = orxSTATUS_SUCCESS;
    ScrollObject* obj ;

    obj = CreateObject("O-EnemyBug");

    DeleteObject(obj);
}

where should i put the deletion??

Comments

  • edited July 2013
    Depends on the circumstances.
    From an event callback, for example, you should call Object->SetLifeTime(orxFLOAT_0) instead.

    In this example, DeleteObject() should be appropriate as long as obj is not NULL.
    What happens when you do that?
Sign In or Register to comment.