Author |
Message |
Lizardheim
DRL Developer
Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
|
Re: Art Dump
Maybe so roast but it doesn't look too good ingame.
|
Fri Jan 27, 2012 11:01 pm |
|
|
Metal Chao
Joined: Sat May 05, 2007 6:04 pm Posts: 2901
|
Re: Art Dump
the more pixels per frame the movement is the choppier it looks, until you have to increase the framerate at which point it looks nicer but you have to make twice as many frames
|
Fri Jan 27, 2012 11:02 pm |
|
|
Lizardheim
DRL Developer
Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
|
Re: Art Dump
|
Fri Jan 27, 2012 11:30 pm |
|
|
madmax
Joined: Sun Apr 22, 2007 8:01 pm Posts: 378 Location: Nomadic
|
Re: Art Dump
metal chao wrote: You move the closest layer three pixels right per frame The second layer two pixels The third one pixel etc
Do this until you have reached a number of frames sufficient to loop all the images to the starting position
Flash will automate this all for you but much prefers vectors to bitmaps and isn't very good at saving bitmaps nicely Any other program like GIMP will make you do all the moving by hand but it is easier to export a nicer looking result using graphics not drawn in-program
Unless you're more specific I can't really help you more than that But that would take like 300 frames for a 100x300 size image, that's awful tedious to move each layer over a few pixels.
|
Fri Jan 27, 2012 11:33 pm |
|
|
Metal Chao
Joined: Sat May 05, 2007 6:04 pm Posts: 2901
|
Re: Art Dump
madmax wrote: But that would take like 300 frames for a 100x300 size image, that's awful tedious to move each layer over a few pixels. Welcome to animating You can probably move more than 3 pixels at a time for a 300 pixel image though, just remember that the more pixels per second you are moving, the choppier the animation will be
|
Fri Jan 27, 2012 11:50 pm |
|
|
Lizardheim
DRL Developer
Joined: Fri May 15, 2009 10:29 am Posts: 4107 Location: Russia
|
Re: Art Dump
Ideally you'd move the background seperate from the framecount and together with how the camera's moving according to "solid ground".
|
Fri Jan 27, 2012 11:58 pm |
|
|
Adriaan
Data Realms Elite
Joined: Mon Oct 12, 2009 11:19 pm Posts: 797 Location: The Netherlands
|
Re: Art Dump
metal chao wrote: madmax wrote: But that would take like 300 frames for a 100x300 size image, that's awful tedious to move each layer over a few pixels. Welcome to animating You can probably move more than 3 pixels at a time for a 300 pixel image though, just remember that the more pixels per second you are moving, the choppier the animation will be Instead of animating all frames manually you could simply code it to move the layers accordingly as well as repeating them when needed, that is assuming you're talking about parallax backgrounds in games.
|
Fri Jan 27, 2012 11:59 pm |
|
|
Metal Chao
Joined: Sat May 05, 2007 6:04 pm Posts: 2901
|
Re: Art Dump
If we're talking about coding it in a game environment everything becomes much easier because you can use linear interpolation to move things between two points, rather than a set number of frames per second. The physics and real positions of things are updated at a capped rate per second (so that time doesn't speed up and slow down with your CPU speed) but the drawing of graphics are updated as many times as the computer can possibly manage, so your image will move 1 pixel at a time 1000 times on a good computer, 2 pixels at a time 500 times on a less good computer or 500 pixels at a time twice on a really awful computer.
It sounded to me like he meant "how do I make a gif" but if it was "how do I code this" it's much easier.
|
Sat Jan 28, 2012 12:01 am |
|
|
madmax
Joined: Sun Apr 22, 2007 8:01 pm Posts: 378 Location: Nomadic
|
Re: Art Dump
Adriaan wrote: metal chao wrote: madmax wrote: But that would take like 300 frames for a 100x300 size image, that's awful tedious to move each layer over a few pixels. Welcome to animating You can probably move more than 3 pixels at a time for a 300 pixel image though, just remember that the more pixels per second you are moving, the choppier the animation will be Instead of animating all frames manually you could simply code it to move the layers accordingly as well as repeating them when needed, that is assuming you're talking about parallax backgrounds in games. That's what I was asking about in the first place, I need to know exactly how to code such a thing, of course I know I can sit there and move each layer manually if I have all the time in the world to spend on it.
|
Sat Jan 28, 2012 12:54 am |
|
|
Metal Chao
Joined: Sat May 05, 2007 6:04 pm Posts: 2901
|
Re: Art Dump
If you know how to draw objects to the screen it shouldn't be hard at all. Have your object move x pixels every update tick (relative to the character), and keep track of how far it has travelled so far. Edit your draw code so that this particular object draws itself twice, once at its actual position and then again at that position - the screen width + how far it has moved so far. Once the stored integer for how far it has gone is equal to or exceeds the width of the layer, have it snap back to its original position.
Then just make more than one of these, have them move at varying speeds and draw them in the correct order when you initialise your objects.
Last edited by Metal Chao on Sat Jan 28, 2012 1:09 am, edited 1 time in total.
|
Sat Jan 28, 2012 1:00 am |
|
|
Adriaan
Data Realms Elite
Joined: Mon Oct 12, 2009 11:19 pm Posts: 797 Location: The Netherlands
|
Re: Art Dump
madmax wrote: That's what I was asking about in the first place, I need to know exactly how to code such a thing, of course I know I can sit there and move each layer manually if I have all the time in the world to spend on it. I don't know what you're programming in, but generally you code the background images to move to the left according to the amount the character move's to the right, which you'll want to multiply/divide by different factors for each layer and vice versa. The images have a far left and far right screen coordinate, so you by comparing those positions you can detect wether or not part of the screen is uncovered by that layer. If it is you draw two instances of the same image, the second one starting on the far left or far right side of the first one when the first one is respectively leaving part of the screen on the left or right uncovered (providing your texture is wrappeable/tileable). Edit: Ninja'd
|
Sat Jan 28, 2012 1:04 am |
|
|
madmax
Joined: Sun Apr 22, 2007 8:01 pm Posts: 378 Location: Nomadic
|
Re: Art Dump
Ok you lost me, I basically thought there was some sort of pre-written script for making a scrolling image. I've never coded in my life so I can't be arsed to figure it out.
|
Sat Jan 28, 2012 1:11 am |
|
|
Metal Chao
Joined: Sat May 05, 2007 6:04 pm Posts: 2901
|
Re: Art Dump
If you want to make an animated gif you'll have to do it by hand I'm afraid. Or download Flash, but it didn't play nicely with bitmap files without a bit of effort last I used it.
|
Sat Jan 28, 2012 1:13 am |
|
|
madmax
Joined: Sun Apr 22, 2007 8:01 pm Posts: 378 Location: Nomadic
|
Re: Art Dump
Nice, did you hand whittle it or Dremel etc.? Poplar's pretty good for such a thing. I've whittled a few replica guns with white pine, not the greatest wood for carving but it works.
|
Sat Jan 28, 2012 2:17 am |
|
|
madmax
Joined: Sun Apr 22, 2007 8:01 pm Posts: 378 Location: Nomadic
|
Re: Art Dump
Nice of you to go to such trouble for a hand made gift. I would like to see the bouquet sometime.
|
Sat Jan 28, 2012 5:48 am |
|
|
|