Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (754)
Games in Android Showcase (229)
games submitted by our members
Games in WIP (842)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  animated background  (Read 1929 times)
0 Members and 1 Guest are viewing this topic.
Offline luisoft

JGO Coder

Projects: 6
Exp: 10 years

Java games rock!

« Posted 2004-11-03 13:58:44 »

Hi there! I am planning to add an animated background to my game. My game is 2D tile based and I wanna know which is the best option for me.

I am planning different background animations depending the level (forest, desert, city,...).

My game is jump'n'run style game.

Should I use sprites in background? And about the performance?

Offline wmjoers

Senior Newbie

Nobody can be uncheered with a balloon.

« Reply #1 - Posted 2004-11-04 04:25:40 »

What type of animated background are you thinking about?

Most of the time when you want to have a scrolling background the most time efficient way to do it is to just draw an image.

Like this (for a side scroller) :

if(x < -imagewidth) {
   x += imagewidth;

Offline luisoft

JGO Coder

Projects: 6
Exp: 10 years

Java games rock!

« Reply #2 - Posted 2004-11-04 14:46:13 »

The player will not interact with the background. For example, in the jungle level, I wanna add an animated background of trees with monkeys jumping around.
In the dungeons level, I wanna add some mysterious eyes, snakes entering in holes, etc. But it is just for fun, the player will not interact with this background, only with the main screen. I hope that I made myself clear
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline mikelomax

Senior Newbie

I know exactly what i'm doing... asking for help

« Reply #3 - Posted 2004-11-05 07:03:38 »

it might be better to use sprites and smaller images to animate than using an animation that has several background images that are all rather large in size, it may cause slowdown. The best way to do it would probably make some sort of "layer" that stores all the things that go into that layer, and when it comes to drawing it, you merely draw the background and all the items in that layer.

The reason for having: A firewall

Independance day, the aliens were destroyed because a computer was used to access their network and disable key systems. If they had had a firewall, the earth would be another worthless rock just floating in space
Pages: [1]
  ignore  |  Print  

DesertCoockie (33 views)
2018-05-13 18:23:11

nelsongames (77 views)
2018-04-24 18:15:36

nelsongames (70 views)
2018-04-24 18:14:32

ivj94 (752 views)
2018-03-24 14:47:39

ivj94 (82 views)
2018-03-24 14:46:31

ivj94 (623 views)
2018-03-24 14:43:53

Solater (98 views)
2018-03-17 05:04:08

nelsongames (179 views)
2018-03-05 17:56:34

Gornova (405 views)
2018-03-02 22:15:33

buddyBro (1065 views)
2018-02-28 16:59:18
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!