Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (477)
Games in Android Showcase (107)
games submitted by our members
Games in WIP (534)
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 / Newbie & Debugging Questions / Re: First Post on: 2008-03-06 01:23:22
http://www.abebooks.com/servlet/SearchResults?sts=t&tn=Killer+game+Programming&x=0&y=0
2  Game Development / Newbie & Debugging Questions / Re: I need some help with finding text in a string and replacing it? on: 2007-11-24 00:41:57
It creates a new String.

1  
2  
String str = object.text.replace("abc", "def");
System.out.prinlnt(str);
3  Game Development / Newbie & Debugging Questions / Re: I need a little help with event listeners in Swing? on: 2007-11-17 17:32:46
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
JTextField txt1 = new JTextField();
      txt1.addActionListener(
            new ActionListener()
            {
               public void actionPerformed(ActionEvent e)
               {
                  doSomething();
               }
            });

JTextField txt2 = new JTextField();
      txt2.addActionListener(
            new ActionListener()
            {
               public void actionPerformed(ActionEvent e)
               {
                  doSomethingElse();
               }
            });
4  Game Development / Newbie & Debugging Questions / Re: Game engines? on: 2007-09-05 03:52:01
http://www.abesbooks.com
5  Game Development / Game Play & Game Design / Re: MMORPG help! on: 2007-09-01 21:57:24
I would suggest learning quite a bit more about Object Oriented Programming, as your other thread in the Newless Clubies section would indicate your knowledge is rather lacking at the moment.  Before you can jump into any kind of programming, (or try to create a MMORPG) you really need to understand, at the very least, the basic mechanics of programming.  You can't jump from the Hello World application to a MMORPG.
6  Game Development / Newbie & Debugging Questions / Re: NullPointer Error - HUH? on: 2007-08-30 06:05:12
You need to change the constructor for Ball to accept a reference to the Applet, and invoke super(applet).

Use Eclipse.  There is no installation involved with Eclipse.  Just extract the folder, and run eclipse.exe.  Create a workspace, create a project, copy your classes into the folder structure Eclipse has created, refresh the project in Eclipse's Package Explorer.  Eclipse is not hard to use at all.
7  Game Development / Newbie & Debugging Questions / Re: Validation of a rotated Block on: 2007-08-27 21:31:35
I developed a tetris clone for a class project.  this is how I handled that.  Everything was based off arrays of single blocks; both the tetris shapes and the dead blocks (the ones that stack at the bottom).  When a tetris piece moved or rotated, before it actually moved/rotated, I would move/rotate a mock shape, to determine if any of the blocks making up the shape breached the playing grid or intersected the dead blocks.  If the mock shape moved/rotated successfully, then I would rotate the actual shape, otherwise the tetris piece either landed or did not rotate.
8  Java Game APIs & Engines / Java 2D / Re: Help jumping in platformer. on: 2007-07-06 05:41:32
This is a snippet of code that I used in a particle generator that I developed.

The code snippet also assumes you are using a coordinate system with every unit being one pixel.

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  
/**
 * Assuming no wind resistance/drag
 * V = velocity
 * THETA = angle of launch (must be in radian form)
 * T = time traveled
 * G = gravity
 * x = V * cos(THETA) * T
 * y = V * sin(THETA) * T - (.5 * G * T^2)
 */

function calculateNewData()
{
   //CALCULATE HOW MUCH TIME HAS PASSED
  long timeDifference = (System.currentTimeMillis() - eventTime);

   //SO I CAN CALCULATE HOW FAR I'VE TRAVELED.
  double distanceTraveled = velocity * timeDifference;

   //CONVERT MY ANGLE INTO RADIANS BECAUSE THAT'S HOW REAL MEN DO MATH
  double radTheta = Math.toRadians(theta);

   //CALCULATE THE X-COORDINATE
  int x = (int)(distanceTraveled * Math.cos(radTheta));

   //CALCULATE THE Y-COORDINATE TAKING INTO ACCOUNT THE FORCE OF GRAVITY
  int y = (int)((distanceTraveled * Math.sin(radTheta)) - (.5 * GRAVITY * Math.pow(timeDifference, 2)));

   //ADD THE NEWLY GENERATED X,Y COORDINATES TO MY ORIGINAL POSITION
  bounds.setLocation(new Point((int)(origLocation.getX() + x), (int)(origLocation.getY() + y)));
};
9  Game Development / Newbie & Debugging Questions / Re: N00b question -- restarting applets? on: 2007-05-22 16:13:53
http://www.cafeaulait.org/course/week5/28.html

*cough*
google search "applet restart"
second result...
*cough*

 Tongue
10  Java Game APIs & Engines / JOGL Development / Re: Editable Textfield on GLCanvas on: 2007-04-14 04:37:58
If you don't want to do the work yourself, there i the fenggui package, which has worked fairly well for me.  http://www.fenggui.org/doku.php
11  Game Development / Newbie & Debugging Questions / Re: Cannot get this to work properly. on: 2007-04-13 00:48:46
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
//CLICK IS TO THE LEFT...
   if(clickX > posX)
    {
      //...and lower than ball
     if(clickY > posY)
      {
        posX --;
        posY ++;
        repaint();
      }
      //...and higher than ball
     if(clickY < posY)
      {
        posX --;
        posY --;
        repaint();
      }
      //...and equal height to the ball
     if(clickY == posY)
      {
        posX--;
        repaint();
      }
    }


not sure the issue of it not moving on the x-axis, but i do have these observations.

1. That should be if clickX < posX

2. use else if statements when you check your y position after already checking if the click is lower than the position.  This prevents unnecessary checks from every having to execute.

3.  why execute posX-- or posX++ inside every if statement.  Since that is the one constant of the larger if statement, call it outside of your y-value checks, and only execute posY-- or posY++ inside your y-value checks.

4.  there are certainly better ways to do this. 

Gotta head to class now, but If no one else has provided a better solution, I'll reply again later tonight.
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.

pw (35 views)
2014-07-24 01:59:36

Riven (33 views)
2014-07-23 21:16:32

Riven (21 views)
2014-07-23 21:07:15

Riven (24 views)
2014-07-23 20:56:16

ctomni231 (55 views)
2014-07-18 06:55:21

Zero Volt (47 views)
2014-07-17 23:47:54

danieldean (38 views)
2014-07-17 23:41:23

MustardPeter (43 views)
2014-07-16 23:30:00

Cero (59 views)
2014-07-16 00:42:17

Riven (56 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!