Java-Gaming.org
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
Featured games (78)
games approved by the League of Dukes
Games in Showcase (406)
games submitted by our members
Games in WIP (292)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Game Development / Game Mechanics / Re: Player Character animation question on: 2012-03-08 03:43:30
If you saw the graphics they had at mojam (http://www.google.ca/imgres?um=1&hl=en&sa=N&tbm=isch&tbnid=BCPPfsCWXPJWOM:&imgrefurl=http://www.reddit.com/user/4c51&docid=kapwIgwopANIoM&imgurl=http://i.imgur.com/Isnl2.png&w=317&h=687&ei=5xtYT_7-EvGp0AHYoM3kDw&zoom=1&iact=hc&vpx=1077&vpy=244&dur=435&hovh=331&hovw=152&tx=120&ty=180&sig=104825597772300283008&page=1&tbnh=155&tbnw=73&start=0&ndsp=15&ved=1t:429,r:9,s:0&biw=1280&bih=688), you could use the getSubimage() method (http://docs.oracle.com/javase/1.4.2/docs/api/java/awt/image/BufferedImage.html) to cycle between the rotations, and have a formula like so

1  
img.getSubimage(animationFrame * 32, 0, 32, 32);


where animationFrame is the current frame in the animation, which you cycle when you move, and you would replace the 32 with the size of the image in pixels (I used 32, because that is what it is in the mojam graphics).

Then you would just set the sub image that you got as the image you draw, and when you walk it would draw the image.
2  Game Development / Newbie & Debugging Questions / Creating a movie with JMF on: 2012-03-03 22:45:57
I have devised a quick little program that captures the screen and puts it in a vector, but my problem is that when I go to save it gives me this error
1  
2  
3  
4  
5  
- create processor for the image datasource ...
Setting the track format to: JPEG
- create DataSink for: C:/Users/Adam/Desktop/Test Video
Cannot create the DataSink: javax.media.NoDataSinkException: Cannot find a DataSink for: com.sun.media.multiplexer.BasicMux$BasicMuxDataSource@7bb0e64a
Failed to create a DataSink for the given output MediaLocator: C:/Users/Adam/Desktop/Test Video


Here is my code where it saves

1  
conv.doIt(Toolkit.getDefaultToolkit().getScreenSize().width, Toolkit.getDefaultToolkit().getScreenSize().height, 30, imgs, ConvertToMovie.createMediaLocator("C:/Users/Adam/Desktop/Test Video"));


and conv is the class I am using for the program. I downloaded it off of a tutorial site, so that shouldn't be the problem.

Thanks for your help.
3  Game Development / Newbie & Debugging Questions / Re: Remove element while being used on: 2012-02-24 22:50:06
Thanks for the help. I am using the Iterator method currently, but please keep posting because I find this very informative.

Also could anyone tell my how I can figure out what FPS my game is running at?

Thanks
4  Game Development / Newbie & Debugging Questions / Remove element while being used on: 2012-02-24 01:16:13
I have a player which can shoot bullets, and I have made it so that when the bullet is out of the frame the bullet gets removed. But when I run the program I get the ConcurrentModificationException error. I have all of my bullets stored in an ArrayList. Is there a simple way to remove the bullets?

Also my technique for game design is still quite basic. Could anyone link me to easy to understand tutorials(preferably video) for 2d game programming?

Thanks for the help
Pages: [1]
Play Revenge of the Titans! The situation is critical. We need fancy commanders to defend Earth, the moon, Mars!
 
Browse for soundtracks for your game!

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

The first screenshot will be displayed as a thumbnail.

The invasion has landed! On Mars! And you're there to beat 'em!
cubemaster21 (66 views)
2013-05-18 05:29:12

alaslipknot (75 views)
2013-05-17 05:24:48

gouessej (107 views)
2013-05-16 08:53:38

gouessej (103 views)
2013-05-16 08:17:58

theagentd (114 views)
2013-05-15 23:01:13

theagentd (103 views)
2013-05-15 23:00:54

StreetDoggy (148 views)
2013-05-14 23:56:26

kutucuk (171 views)
2013-05-13 01:10:36

kutucuk (169 views)
2013-05-12 23:36:09

UnluckyDevil (178 views)
2013-05-12 13:09:57
Complex number cookbook
by Roquen
2013-04-24 20:47:31

2D Dynamic Lighting
by Oskuro
2013-04-18 00:46:12

2D Dynamic Lighting
by Oskuro
2013-04-18 00:45:57

2D Dynamic Lighting
by Oskuro
2013-04-18 00:23:20

Noise (bandpassed white)
by Roquen
2013-04-06 01:36:01

Noise (bandpassed white)
by Roquen
2013-04-04 00:17:38

Java Data structures
by Roquen
2013-03-29 21:21:12

Topic Request
by kutucuk
2013-03-23 05:42:01
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!
Page created in 0.115 seconds with 21 queries.