2 Replies - 339 Views - Last Post: 17 September 2013 - 05:49 AM Rate Topic: -----

#1 LunaRebirth   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 132
  • Joined: 21-March 13

SDL & C++ - Updating the background image alone

Posted 16 September 2013 - 09:44 PM

So i have this problem i didnt fully think through.
If you followed my TileEditor post, youll probably understand my problem.
(If not, ill explain it! :) )

What i did was make a TileEditor in which i can place images. Little square images from a TileSet image.
This creates a level-looking image.
I can click to set down a tile, enough tiles as i would like. These tiles can be formed together to make houses, beaches, ect.

Each tile has a soecific peice of identity. Telling which tile is which (allowing me to have multiple images. As many as id like without any limits - since i cant tell exactly how many the person creating the level will use.)

These tile identities are based on TileFrame.
This is used through vectors.

If i were to make a system to allow my player to walk on these tiles, since each image updates each frame (loops through the amount of tiles set, then back to 0) meaning that if i had 60 tiles placed, if my character moves, each tile updates on its' own identity frame.
So if my 3rd set tile was walked over, once every 60 frames on the 3rd frame, it would update. Leaving a trail where the player walked.

I guess im trying to say... How can i use these vectored tiles to be placed, but each and EVERY tile update every frame?
Right now each tile updates once every (amount of tiles placed). This makes it near-impossible for me to make anything that moves.
I cant have my background image in a loop either, or each (amount of tiles placed), the background will just remove each image and then re-add them.

If you dont understand, i could try to clarify with maybe a video or code samples. If you do, however, understand. Much appreciated! Trying to make this post as simple to answer as can be.

Thanks! Luna

Is This A Good Question/Topic? 0
  • +

Replies To: SDL & C++ - Updating the background image alone

#2 snoopy11   User is offline

  • Engineering ● Software
  • member icon

Reputation: 1554
  • View blog
  • Posts: 4,930
  • Joined: 20-March 10

Re: SDL & C++ - Updating the background image alone

Posted 16 September 2013 - 09:48 PM

code for updating the tiles is .....?

any clues..... perhaps....?
Was This Post Helpful? 0
  • +
  • -

#3 jimblumberg   User is online

  • member icon

Reputation: 5653
  • View blog
  • Posts: 17,355
  • Joined: 25-December 09

Re: SDL & C++ - Updating the background image alone

Posted 17 September 2013 - 05:49 AM

If this is related to one of your previous topics I suggest you post the question in that topic. As it is you haven't provided enough content for us to be any help.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1