Animate background with many frames?

Started by Ozwalled, Sat 29/01/2005 21:22:16

Previous topic - Next topic

Ozwalled

Something I wanted to do in my game was have a background animate with many frames (I'm thinking somewhere around 15 or so frames would likely do the trick, though if I work it good, I might be able to squeeze it down to less).

If it makes any difference, these would occur during an old-school RPG-like combat sequence (where the player sprite dissapears and the player can't leave until combat ends somehow) , where the player would more or less be interacting with GUIs to attack, use powers, use an item, etc.

Given the background frames limitation, I'm not sure how I'd approach this problem at all. The ONLY thing I thought of was to maybe have a looping shift between several rooms, but I have a weird feeling that won't work. And otherwise, I don't know where to even start.

....in short, I thought it would be nice to have a background effect that looked something like this, only on a larger scale:

Any suggestions?

Ishmael

#1
The room's repeadetly_execute_always function and the RawDrawImage function in conjunction?

Like:
(say the sprites for the background are numbers 10-25)

int bgtimer = 10;

function repeadetly_execute_always {
  if ((bgtimer > 9) && (bgtimer < 25)) {
    RawDrawImage(0,0,bgtimer);
    bgtimer++;
  } else {
    RawDrawImage(0,0,bgtimer);
    bgtimer = 10;
}

But that would make the background advance a frame per game loop... I can't right now think of a way to to delay this though.
I used to make games but then I took an IRC in the knee.

<Calin> Ishmael looks awesome all the time
\( Ö)/ ¬(Ö ) | Ja minähän en keskellä kirkasta päivää lähden minnekään juoksentelemaan ilman housuja.

Ozwalled

Hm. Never thought of RawDrawImage for this (yup, I'm a dummy). It just might work!

Might that be likely to bog things down badly, though?

Etcher Squared Games

Quote from: Ishmael on Sat 29/01/2005 21:31:38
But that would make the background advance a frame per game loop... I can't right now think of a way to to delay this though.

something simple like this would work


int nCycle;
int nEvery = 10;

function repeat_execute()
{
  nCycle = nCycle + 1;
  if (nCycle >= nEvery)
  {
      nCycle = 0;
      DoNextDesiredFrame();
  }
}


and you could change nEvery depending on the game speed so that your frame still change on the same time basis.

So, like if you wanted 10 changes a second

nEvery =  GetGameSpeed / 10;


I couldn't find an event to trigger when the gamespeed changes.
You could probably either do this on a GUI where you change speed or just calculate it every cycle
website: http://www.etcher2games.com/
email: etcher2games@yahoo.com
forum: http://www.etcher2games.com/forums

Anyone want to make my website for free?

SMF spam blocked by CleanTalk