Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (427)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (466)
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  
  how do you use animated sprites?  (Read 1462 times)
0 Members and 1 Guest are viewing this topic.
Offline MarianoArg

Junior Newbie





« Posted 2005-07-22 19:54:33 »

i am programming some kind of  "1942" game...

i'm using an animated gif for my main plane player.

I'm using applets so i can insert an animated gif without problem... This animated sprites is composed by 3 static images.

My question is:
is this the right way to work? should i use the 3 static images and loop them in my .class file or just insert the animated gif?

i hope i made myself clear, my english isn't that good  Undecided

kul_th_las
Guest
« Reply #1 - Posted 2005-07-22 20:23:34 »

You're using AWT/Swing?

I would recommend looping 3 static images. I remember having issues with AWT and animated .gif files, where they would all flash when there was more than 1 on the screen, unless they all had their own ImageObserver object, or something like that.

Basically, building a small sprite/animation lib to do the simple things you want to do will pay off in the long run. It also lets you do cool things like directly controlling the framerate during debugging of the collision code (and other things) so that you can see everything in slow motion if you need to. Extremely helpful.
Offline MarianoArg

Junior Newbie





« Reply #2 - Posted 2005-07-22 20:32:30 »

i'm using applets...  Embarrassedit's my first game ever  Embarrassed
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Jeff

JGO Coder




Got any cats?


« Reply #3 - Posted 2005-07-23 06:02:46 »

Applets are actually the second hardest Java graphics programming environment  (MIDP1.0 is the hardest)
Unless you really want to do Applets in the long run, Id move to writing Java APplications.  There is a
lot more you can do from an Application then from an Applet.

About the only reason thse days to write applets is if you absolutely must embed the Java program in an HTML page.
If you dont mind the game popping up in a seperate window from the HTML, you can launch a Java
application from a web page using Java Web Start,

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline g666

Junior Member





« Reply #4 - Posted 2005-07-28 21:24:17 »

one reason to use applets is that most people have never heard of java webstart and it doesnt help that web browsers dont recognise the files either(well IE and firefox on all machines i use dont), so people are like. what i downloaded a game but it is only 1kb big and it wont let me play it.  Grin

desperately seeking sanity
Offline Jeff

JGO Coder




Got any cats?


« Reply #5 - Posted 2005-07-29 23:19:49 »

one reason to use applets is that most people have never heard of java webstart and it doesnt help that web browsers dont recognise the files either(well IE and firefox on all machines i use dont),

It works fine on IE AND firefox on all my machines. WIn32 and Linux.   If youve installed a recent JRE then thats not your rpoblem.

Its more likely that your webserver is failing to return thr right mime type.  Without that it may not get recognized.

Got a question about Java and game programming?  Just new to the Java Game Development Community?  Try my FAQ.  Its likely you'll learn something!

http://wiki.java.net/bin/view/Games/JeffFAQ
Offline g666

Junior Member





« Reply #6 - Posted 2005-07-30 16:14:53 »

one reason to use applets is that most people have never heard of java webstart and it doesnt help that web browsers dont recognise the files either(well IE and firefox on all machines i use dont),

It works fine on IE AND firefox on all my machines. WIn32 and Linux.   If youve installed a recent JRE then thats not your rpoblem.

Its more likely that your webserver is failing to return thr right mime type.  Without that it may not get recognized.


For some reason it works now XD, but for a long peroid of time it didnt.

Incidently, when i had an older versoin of the jdk installed(cant remeber which), i was able to double click on *.jar files and if they contained a class file with a main method they would load that program. When i installed a newer jdk, windows doesnt recognise *.jar files and i can open them any way other than the command line. does anybody know why this is?

desperately seeking sanity
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (78 views)
2014-04-15 18:08:23

BurntPizza (70 views)
2014-04-15 03:46:01

UprightPath (81 views)
2014-04-14 17:39:50

UprightPath (66 views)
2014-04-14 17:35:47

Porlus (82 views)
2014-04-14 15:48:38

tom_mai78101 (106 views)
2014-04-10 04:04:31

BurntPizza (166 views)
2014-04-08 23:06:04

tom_mai78101 (262 views)
2014-04-05 13:34:39

trollwarrior1 (212 views)
2014-04-04 12:06:45

CJLetsGame (221 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30
java-gaming.org 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‑gaming.org
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!