Java-Gaming.org Hi !
Featured games (81)
games approved by the League of Dukes
Games in Showcase (513)
Games in Android Showcase (119)
games submitted by our members
Games in WIP (576)
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  Discussions / General Discussions / Re: XBox One on: 2013-05-26 16:50:58
For me Xbox One is a bit step to failer.... All the TV features and sports and all that they prommised are useless outside USA. The only thing that i would buy a Xbox one is for the Exclusives but everytime i hear hows this hardware works makes changes my mind. Always online Kinect? always online requirement?Used games not usable anymore?small harddrive not be able to remove it? all this are crappy moves that shot thier own product down. If this continues i am going to move to Sony.... I loved my Xbox 360 but ... the new Xbox? is just a piece of garbage.
2  Game Development / Newbie & Debugging Questions / Re: I need some help with Loading Images outside Eclipse IDE on: 2013-05-25 21:02:50
Fixed it... finaly... it was a mistake because i misspelled enemy.png its enemy.PNG .... Stupit me ^_^ thank you everyone for the help to load images i used URL Smiley as alaslipknot said thank you
3  Game Development / Newbie & Debugging Questions / Re: I need some help with Loading Images outside Eclipse IDE on: 2013-05-25 20:51:48
Yes the problem is the way i load images indeed.... I created a folder name "Res" and then i load it as Class Folder though Propertise for plane java build path / Libraries.

I used
1  
2  
URL url = this.getClass().getResource("bullets.png");
            System.out.println(" " + url);


to see what does it point too and its returns me null but if i put /bullets.png intended it point me to the file in my hard drive folder. I am confused Sad
4  Game Development / Newbie & Debugging Questions / (Solved)I need some help with Loading Images outside Eclipse IDE on: 2013-05-25 16:16:19
Hello everyone! i would like help for a problem that i continuesly have... This is my first Post and sorry if my english or post is not perfect. I was working on a game and everytime i stuck on the same problem. While i try to load images, i succesded inside Eclipse IDE but when i export it i get error. I tryed to make a res folder and add it into my project libraries which used to solve this problem but at the moment again i have issues. I don't know what to do or how to fix it. Is a bug of Eclipse IDE ? or something i am doing wrong.


My Resources class which i use to load all my images is the following:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
public class Resources extends Component {
   private static final long serialVersionUID = -8912492884211057348L;
   public static BufferedImage bullet,craft,emeny,bg1,bg2;

     public Resources(){
     
         try {
             ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
             InputStream input = classLoader.getResourceAsStream("bullets.png");
             
            bullet = ImageIO.read(input);
           
             input = classLoader.getResourceAsStream("airplane.png");
            craft = ImageIO.read(input);
           
             input = classLoader.getResourceAsStream("background.png");
            bg1 = ImageIO.read(input);
         
             input = classLoader.getResourceAsStream("enemy.png");
            emeny = ImageIO.read(input);
         } catch (IOException e) {
         }
      }
   
}


After that in my Main Method which is plane.class where i create a JFRAME for my game and i add a new board() which is where i do everything else. Here is my Main Plane method:

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
 extends JFrame {
   /**
    *
    */

   private static final long serialVersionUID = 8957704465368507754L;
   public static final int DISPLAY_HEIGHT = 800;
   public static final int DISPLAY_WIDTH = 600;


   plane() {
   
      super("Plane");// INITIALISE THE JFRAME

      setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

      setSize(new Dimension(DISPLAY_HEIGHT, DISPLAY_WIDTH));
      setLocationRelativeTo(null);

      setResizable(false);
      Resources r = new Resources();
      add(new board());
      setVisible(true);
   }

   public static int getDISPLAY_HEIGHT() {
      return DISPLAY_HEIGHT;
   }

   public static int getDISPLAY_WIDTH() {
      return DISPLAY_WIDTH;
   }

   public static void main(String[] args) {
      new plane();
   }

}


I create an Resources object with the name r which loads all the Images. And now about my Board class which the paint method looks solike this

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
   public void paint(Graphics g) {
      paintComponent(g);
      g.setFont(new Font("Arial", 0, 25));
      g.setColor(new Color(255, 5, 128));

      g.drawImage(Resources.bg1, back1.getX(), back1.getY(), this);
      g.drawImage(Resources.bg1, back2.getX(), back2.getY(), this);

      craft.paint(g);
      for (int i = 0; i < weapon.size(); i++) {
         weapon.get(i).paint(g);
      }
      for (int i = 0; i < 5; i++) {
         enemyarray[i].paint(g);
      }


When i run it though Eclipse IDE works excelent but when i want to create a stand alone .jar it throws me

Exception in thread "main" java..lang.IllegalArgumentException: input == null! to my Resourse Class.

I have continuesly have problems with this issue and sometimes i solve it but always seems to come back. I would like if someone could help me with issue.

In addition , while i was doing some research on how to load and read images i created this class

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
25  
26  
27  
28  
29  
30  
31  
32  
33  
34  
35  
36  
37  
38  
39  
40  
41  
42  
43  
44  
45  
46  
47  
48  
49  
50  
51  
52  
53  
54  
55  
56  
57  
58  
package com.petrosarts.plane;


import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import java.io.*;
import java.net.URL;

import javax.imageio.*;
import javax.swing.*;
 
/**
 * This class demonstrates how to load an Image from an external file
 */

public class LoadImageApp extends Component {
           
    public static BufferedImage img;
    public static  ImageIcon image;
    public void paint(Graphics g) {
        g.drawImage(LoadImageApp.img, 0, 0, null);
    }
 
    public LoadImageApp() {
       try {
          ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
          InputStream input = classLoader.getResourceAsStream("strawberry.jpg");
       
           img = ImageIO.read(input);

       } catch (IOException e) {
       }
 
    }
 
    public Dimension getPreferredSize() {
        if (img == null) {
             return new Dimension(100,100);
        } else {
           return new Dimension(img.getWidth(null), img.getHeight(null));
       }
    }
 
    public static void main(String[] args) {
 
        JFrame f = new JFrame("Load Image Sample");
             
        f.addWindowListener(new WindowAdapter(){
                public void windowClosing(WindowEvent e) {
                    System.exit(0);
                }
            });
 
        f.add(new LoadImageApp());
        f.pack();
        f.setVisible(true);
    }
}


which runs perfectly and it works outside IDE which is wierd cause i tryed to do the same technique on mine but didn't work out.
Thank you in advance for your help.
5  Game Development / Newbie & Debugging Questions / Re: What have been/are your learning techniques? on: 2013-03-27 23:29:17
I am new to this site but no new to Java Programming. I start learning Java at College and after that i always loved video games. And Java was the only program language i knew. Although like you my excitment to make something awesome makes me just to hard part immateriality it learn that thats just impossible. So i started with some small tutorials on how to make video games in java. Although that didn't really work either. What i found out that kind of work is make simple games like a pong,tetris,arkanoid. Games that are kind of simple but offer challenge. I red a article at GameDev not long ago that was explain on how someone can start with game programming which was really interesting.

What i am doing at the moment is code something simple and when you finish with one simple game go to something more advance and when you finished with the second go back to your first and see what you can improve. And after you finished all this then all games are kind of the same. You just reuse code from one game to another.

I really want to make games and i hope that someday i will.
6  Discussions / Business and Project Management Discussions / Greedings i was wondering... on: 2013-03-27 21:35:10
Hello everyone , I am new member in this community and i was wondering If anyone is interesting to work together to make something in Java. I want to learn more and become better at coding in Java. I've graduated in Computer Science 2011 and since then i am trying to learn to code mostly games in Java.
I've learn a lot of things by my self but its better if i could find someone who has more experience than me and has the time to help me.
I have so many ideas that i wish i could implement them in a Game. If anyone is interesting pm me and we can talk. Thanks
Pages: [1]
 

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

The first screenshot will be displayed as a thumbnail.

Longarmx (39 views)
2014-10-17 03:59:02

Norakomi (30 views)
2014-10-16 15:22:06

Norakomi (24 views)
2014-10-16 15:20:20

lcass (28 views)
2014-10-15 16:18:58

TehJavaDev (57 views)
2014-10-14 00:39:48

TehJavaDev (58 views)
2014-10-14 00:35:47

TehJavaDev (48 views)
2014-10-14 00:32:37

BurntPizza (64 views)
2014-10-11 23:24:42

BurntPizza (36 views)
2014-10-11 23:10:45

BurntPizza (78 views)
2014-10-11 22:30:10
Understanding relations between setOrigin, setScale and setPosition in libGdx
by mbabuskov
2014-10-09 22:35:00

Definite guide to supporting multiple device resolutions on Android (2014)
by mbabuskov
2014-10-02 22:36:02

List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06
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!