Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (482)
Games in Android Showcase (110)
games submitted by our members
Games in WIP (550)
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] 2
1  Game Development / Newbie & Debugging Questions / How to Download This API ? on: 2010-08-18 02:45:46
I want to use this API posted by Oracle.

http://download.oracle.com/docs/cd/B14099_19/wireless.1012/b14043/oracle/panama/spatial/mapper/BoundingBox.html

How do I download it ?
2  Game Development / Newbie & Debugging Questions / Re: Additional work to get Applets to run on a MAC ? on: 2010-08-15 14:34:07
Nothing works. I was reading on it online and apparently It'll work if I compile my source code on a MAC Computer. I don't have a MAC so I'll look around some more and let you guys know If I find anything.
3  Game Development / Newbie & Debugging Questions / Re: Additional work to get Applets to run on a MAC ? on: 2010-08-10 14:25:46
I tested the console on Windows and I was able to see the trace of any exceptions I created. On a mac the console doesn't provide any feedback.

This is the source code for the Applet. It adds 2 numbers and displays the progress on the console.

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  
59  
60  
61  
62  
63  
64  
65  
66  
67  
68  
69  
70  
71  
72  
73  
74  
75  
76  
77  
78  
79  
80  
81  
82  
83  
84  
85  
86  
87  
88  
89  
90  
91  
92  
93  
94  
95  
96  
import java.awt.Graphics;   // program uses class Graphics
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JApplet; // program uses class JApplet
import javax.swing.JButton;
import javax.swing.JOptionPane;

  public class AdditionApplet extends JApplet{
     
     public JButton RunButton;
     private double sum; // sum of values entered by user
   
       public void init(){
         
          // Run Program Button
        RunButton = new JButton("Run");
         
         // Add Run Button Action Listener
        RunButton.addActionListener(new RunButtonListener());
         
         // Add the Run Button to the JApplet
        add(RunButton);
         
       }
     
    public void start(){
       
    }
     
     public void paint( Graphics g ){
       
        // call superclass version of method paint            
       super.paint( g );
     }
     
     public void doWork(){
       
        // Get raphic Object
       Graphics g = getGraphics();
       
        // Update the Frame (Redraw)
       update(g);
       
        // Method Call
       myPaint(g);
     }
 
    public void myPaint(Graphics g){
 
      String firstNumber; // first string entered by user
     String secondNumber; // second string entered by user

      double number1; // first number to add
     double number2; // second number to add

      // obtain first number from user
     firstNumber = JOptionPane
            .showInputDialog("Enter first floating-point value");

      System.out.println("First Number Entered = " + firstNumber);
     
      // obtain second number from user
     secondNumber = JOptionPane
            .showInputDialog("Enter second floating-point value");
     
      System.out.println("Second Number Entered = " + secondNumber);
     
      // convert numbers from type String to type double
     number1 = Double.parseDouble(firstNumber);
      number2 = Double.parseDouble(secondNumber);

      sum = number1 + number2; // add numbers
     
      // draw rectangle starting from (15, 10) that is 270
     // pixels wide and 20 pixels tall
     g.drawRect(15, 10, 270, 20);

      // draw results as a String at (25, 25)
     g.drawString("The sum is " + sum, 25, 25);
     
      System.out.println("The result is = " + sum);
    }
   
// Inner class which will dictate RunButton Actions
class RunButtonListener implements ActionListener {

      public void actionPerformed(ActionEvent e) {

         remove(RunButton); // Remove the Button when Pressed
       
         doWork(); // Do Some Work
     }

   }
}// end Applet Class



This is the HTML Page that I'm using to call the Applet.

1  
2  
3  
4  
5  
6  
7  
<html>
<applet codebase = "bin/"
code = "AdditionApplet.class"
Width = 700
Height = 300>
</applet>
</html>
4  Game Development / Newbie & Debugging Questions / Re: Additional work to get Applets to run on a MAC ? on: 2010-08-10 11:40:22


This is what MAC Users get with my Applet, but they're able to run other applets.
Also He doesn't get an exception.
5  Game Development / Newbie & Debugging Questions / Additional work to get Applets to run on a MAC ? on: 2010-08-10 10:03:39
I created and applet which works fine on Windows, but users on a MAC get a red X.

Is there anything special that I have to do to my source code or HTML code to get MAC users to use my applet ?
6  Game Development / Newbie & Debugging Questions / Re: Accessing Images inside a Jar File on: 2010-02-11 03:52:25
I figured it out. It turns out we can make Jar Objects.
7  Game Development / Newbie & Debugging Questions / Accessing Images inside a Jar File on: 2010-02-11 00:33:19
Let's say I put a Folder named "Images" with Image1.jpg inside a Jar File named ImageJar. Then I drop the Jar file in my C:\ Directory. How will I be able to contact the Jar, Get inside It's Images folder and load up Image1.jpg ?

Will it be something like this ?


 String ImageFile = "C:/ImageJar/Images/Image1.jpg";

 URL ImageURL = getClass().getResource(ImageFile);

 Image Picture = new ImageIcon(ImageURL).getImage();

8  Game Development / Newbie & Debugging Questions / Re: Jar File Image Loading Problem on: 2010-02-10 01:27:54
This piece of code did it for me....

URL imageURL = getClass().getResource(“ImageDirectory/ImageFile.jpg”);
Image Picture = new ImageIcon(imageURL).getImage();

Thanks Zoto.
9  Game Development / Newbie & Debugging Questions / Jar File Image Loading Problem on: 2010-02-09 22:09:42
I just learned how to create Executable jar Files and package Folders into Jar files. The problem I have is that my Executable jar file loads the Image in the directory in which it was created, but once I move it somewhere else It doesn't load the Image.
10  Java Game APIs & Engines / Java 2D / Re: Drawing from Left to Right ? on: 2010-01-21 05:08:07
That's a good Idea. I'll try that.

Thanks.
11  Java Game APIs & Engines / Java 2D / Re: Drawing from Left to Right ? on: 2010-01-21 00:26:23
This is the problem I'm having...

The character in my game can dash. When he dashes to the left, and stops he stops where he is in the screen.



Now when I dash to the right, and he stops he appears in the last position of the smoke (The Yellow Part). He even flashes as he dashes to the right.



Watch the streaming Video to see it in action

VIDEO = http://www.screentoaster.com/watch/stUE9dQ0RIR19bQF5YWl5QUVBW/glitch

This is why I think the problem is coming from Javas default way of drawing which is from Left to Right. So making it draw from Right to Left when the character is looking to the right might fix the problem, I'm just not sure how to switch it and where to implement this.

My draw statement looks like this...

g.drawImage(MasterGX.getImage(), (int)MasterGX.getX() , (int)MasterGX.getY(), MasterGX.getWidth(),MasterGX.getHeight(), null);

NOTE : "MasterGX" is the characters Name.
12  Java Game APIs & Engines / Java 2D / Drawing from Left to Right ? on: 2010-01-19 11:03:45
When you draw in Java it automatically draws from Left to Right. How can I invert this so the sprites are drawn from Right to Left ?
13  Game Development / Newbie & Debugging Questions / Re: Where to Input Java commands ? on: 2009-08-17 22:57:27
Run the batch file from marioai\classes. Your java folder will need to be in the system path.

THANK YOU. Now I can start testing it.
14  Game Development / Newbie & Debugging Questions / Re: How can I practice my Java skills? on: 2009-08-17 05:17:03
Learn more advanced topics like threads,networking,servelts and so on...
15  Game Development / Shared Code / Re: 2D Map editor on: 2009-08-17 02:15:11
How do I run this ? Thanks.
16  Game Development / Newbie & Debugging Questions / Re: Where to Input Java commands ? on: 2009-08-17 02:13:08
I made a batch file with the command given to me by that website which was....

java ch.idsia.scenarios.Play

Where do I have to execute the batch file exactly ?
17  Game Development / Newbie & Debugging Questions / Where to Input Java commands ? on: 2009-08-17 02:01:47
I ran across this link where they have this Mario AI competition and I wanted to execute the program. I'm not sure where to input the commands that they are showing me there.

http://julian.togelius.com/mariocompetition2009/gettingstarted.php

Thanks for the help.
18  Game Development / Newbie & Debugging Questions / Re: How to Create .JNLP files ? on: 2009-06-07 20:49:20
I have no idea about Eclipse, but in Netbeans you can setup your project to be runnable via webstart. But changing an IDE just because of webstart support might be a bit overkill, since understanding the guts of webstart/jnlp wouldn't be bad anyway.

I'll try it manually, and if that doesn't work I'll switch to NetBeans lol
I just don't know where to use those commands posted in the tutorial
19  Game Development / Newbie & Debugging Questions / Re: How to Create .JNLP files ? on: 2009-06-07 16:15:16
Thanks CaptainJester.

and where do I put these commands ? lol
20  Game Development / Newbie & Debugging Questions / How to Create .JNLP files ? on: 2009-06-04 22:25:37
So I have a game that isn't really complete and I wanna show what I have to my friends. How can I turn my project into a .JNLP file with Eclipse ? or do I need another IDE ?
21  Discussions / General Discussions / Re: Which Compiler do you use to Make games ? on: 2009-04-22 07:30:46
I posted this a long time ago, but I know better now lol.
22  Java Game APIs & Engines / Java 2D / Re: my first java game ("rpg" kind of ..) on: 2009-01-04 01:12:16
This post is from 2006...Just thought I would let you guys know if you didnt notice..  persecutioncomplex

omg LMAO
23  Java Game APIs & Engines / Java 2D / Re: my first java game ("rpg" kind of ..) on: 2008-12-31 03:35:43
Hey nice game. I noticed that when I try to run in the opposite direction he has a delay before he starts to move. The problem might be that you have these calculations inside the Key Listener class so moving them out of there should make it smoother.

 I also have a game like this but I don't know how to turn it into a JNLP executable like you did. Can anyone show me a tutorial that shows me how ?

Thanks.
24  Discussions / General Discussions / Which Compiler do you use to Make games ? on: 2008-06-27 19:58:47
I'm using Eclipse 3.2. What are you using ?

25  Game Development / Game Play & Game Design / Re: Java 2D Fighting game on: 2008-06-15 16:46:12
Make a Player Object that contains an Animation. and inside it have a Method that changes the Animation when a certain Button is pressed. Make sure all the Animations are loaded as soon as the program starts to run.
26  Java Game APIs & Engines / Java 2D / Re: 2D Side Scroller Question on: 2008-06-15 15:21:29
The tile map isn't a component.  You just create a 2d array of tiles.  And then draw them.  Typically, you would draw them within the frame's paintComponent method if you have everything in a frame.

The book "Developing Games in Java" by David Brackeen shows you all the basics of programming a 2d tile-based platformer.

Thanks for the tip.I was able to do What you said. I created a Text file that represents a Map then It's read and the corresponding Letter in the text file will copy the corresponding Tile to a 2D Image Array. Then I drew this 2D Image Array into the screen and my Animation is moving fine inside it. Do you have any Ideas on how to make the camera scroll Huh
27  Java Game APIs & Engines / Java 2D / Re: 2D Side Scroller Question on: 2008-06-08 03:23:29
Yeah that's the book I'm reading. I was doing fine until I reached chapter 5 where he talks about tile maps. I'll just re-read till I understand or something.
28  Game Development / Newbie & Debugging Questions / Re: question about JARs within JARs on: 2008-06-07 01:55:36
I'm also creating a game, and I have an Animation that moves freely inside a frame. I'm trying to add a side scrolling tile map, but I'm kind of stuck there. Anyways, I test it with my controller using a program called "Joy To Key" it transfers controller input into keyboard presses when you configure it. If what you want to do is not possible this can serve as a second option.
29  Java Game APIs & Engines / Java 2D / 2D Side Scroller Question on: 2008-06-06 17:08:53
I'm trying to make a game and I currently have an Animation that moves around and jumps inside a 800x600 frame. I want to add this animation inside a 2D Tile based environment (Sort of like Mario Bros. ). Do I have to ditch the frame, and use the Tile Map ? or the Tile Map goes inside the frame ? Can anyone tell me How to get started in making a Tile Based Map for me to put the Animation ?

Thanks  Cool
30  Game Development / Newbie & Debugging Questions / Re: How to Execute a KeyEvents ONCE ??? on: 2008-06-05 17:43:04
Didn't you ask this on GameDev.net?  I answered you there.

I've never been to that website. You have me mistaken.
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

CopyableCougar4 (14 views)
2014-08-22 19:31:30

atombrot (28 views)
2014-08-19 09:29:53

Tekkerue (25 views)
2014-08-16 06:45:27

Tekkerue (23 views)
2014-08-16 06:22:17

Tekkerue (15 views)
2014-08-16 06:20:21

Tekkerue (22 views)
2014-08-16 06:12:11

Rayexar (61 views)
2014-08-11 02:49:23

BurntPizza (39 views)
2014-08-09 21:09:32

BurntPizza (31 views)
2014-08-08 02:01:56

Norakomi (37 views)
2014-08-06 19:49:38
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!