Stratos: Punto de Encuentro de Desarrolladores

¡Bienvenido a Stratos!

Acceder

Foros





CRM32Pro_CSprite::SetPosition(x, y, 1 ?? )

Iniciado por Mikenoworth, 10 de Enero de 2007, 09:42:43 PM

« anterior - próximo »

Mikenoworth

// cascades the sprites
CRM32Pro_CSprite* cspr = get_spr(spr2);
cspr->SetPosition(10, 10, 0);
cspr = get_spr(spr3);
//cspr->SetPosition(20, 20, 0);
cspr->AutoRestore(0);

//cspr = NULL;

int x = 60, y = 60;

while(!done)
{      
++x; ++y;
cspr->SetPosition(x, y, 1);
spr_man_logic();

while(CRM32Pro.Update(&event))
{
switch(event.type)
{
case SDL_MOUSEBUTTONDOWN:                
break;
case SDL_QUIT:
done = 1;
break;
case SDL_KEYDOWN:
if(event.key.keysym.sym == SDLK_ESCAPE) done = 1;                    
break;
default:
break;
}
}
}


I've tried multiple methods, but the result is always the same - The sprite seems to repeat the path, drawing copies of itself throughout the path.

I've done exactly what the rabbit example does with movement. yet, it's crud. What did I miss?

spr_man_logic() simply sorts the sprites on a per layer basis, and checks for collision, it does nothing with the sprites position.

TheAzazel

Mike, I would need a full compileable example to check in my computer what´s going on, so, could you isolate that piece of code? (render callback included)

I will go on leave until next Sunday so you have to use some of your patient hehehe

cheers!

P.S.: although.. I can see you disable the autorestore of the sprite so in your render callback, you have to blit the whole background image before to draw each sprite.

Mikenoworth

This is bad to say, but as I was debugging and cleaning up code, the problem went away.  :?:  So I don't know why it was happening but again.. it is gone.   :roll:

TheAzazel

Well, that was fine then :)

we are longing for a release of your game!!!

Cheers!

Mikenoworth

I want the same thing, but bad game design and the need for editors slows game progress.

  I'm working on it at least 8 hrs day.   :)






Stratos es un servicio gratuito, cuyos costes se cubren en parte con la publicidad.
Por favor, desactiva el bloqueador de anuncios en esta web para ayudar a que siga adelante.
Muchísimas gracias.