Author Topic: Problem with animations  (Read 2467 times)

kolyamatic

  • Guest
Problem with animations
« on: February 25, 2013, 02:12:21 PM »
As I am currently working on getting a little game going, I have created my very own save-format. (well at least, I haven't seen it being used anywhere else before)
And thus far it works rather well - I am able to put simple images ("static" images, as I like to call them) on a 640x480 screen using a 40x30 savefile.
But that's the problem - I am only able to put static images, not animations. (I had struggled with them before already, as Cyber might remember me ;-))

Finally I feel the need of someone's help, after some days of not finding a solution.
(as I don't think you have understood me, I'll attach some files; they may not look good in both coding layouts and folder organising)




-- Kolyamatic

Cybermonkey

  • Administrator
  • *****
  • Posts: 0
Re: Problem with animations
« Reply #1 on: March 04, 2013, 05:24:05 PM »
Sorry for answering so late but I still don't understand what you want to achieve.

kolyamatic

  • Guest
Re: Problem with animations
« Reply #2 on: March 05, 2013, 02:57:56 PM »
No worries, I don't mind.

Okay, here it is again:
I have a file (a .png in this case). For this I'll call it sv0.
sv0 has a width of 40p and a height of 30p.
Now, every pixel has a colour in RGB-format.
For the static images I used the values of red; I had also an array, in which all the images are stored.
Then I introduced a mechanism: the programme reads the first pixel (its reddishness) of sv0. With that value, it puts the according image on the screen.
An example: the reddishness of the first pixel is 5. Hence, the fifth image in the array (TERR[5]) is loaded onto the screen.
(if you're wondering why it is 40-30; my programme's window is 640-480, using 16x16 images)
Anyway, I hoped you now understand what I huddle round with.

And now, you may also be able to understand my problem with the animations and might even help me.
I think it might also just be that I don't quite understand the whole animation thing right just yet.

(Oh, BTW - I have found a solution for this without using "proper" animations)