Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (577)
games submitted by our members
Games in WIP (498)
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 / Artificial Intelligence / Re: Help with RPG´s on: 2008-06-12 05:20:16

  Thanks, I think this will help me a lot  Smiley
     
2  Game Development / Artificial Intelligence / Help with RPG´s on: 2008-06-11 02:10:56

  I need help, i am trying to make a RPG but i dont know how to manage events and so on dialogs!!!!,
   so please can you help me???!!, i know how to load maps from files and that stuff but i really dont
   now how to manage events  Sad

     
3  Java Game APIs & Engines / Java 2D / Re: Best engine for a 2d game? on: 2008-04-08 03:19:25

  Well actually there is a java port of SDL  Tongue
      So if you´re happy with SDL, you can use SDL with java  Tongue
4  Game Development / Newbie & Debugging Questions / Re: Clipping on: 2008-03-30 18:12:18
  I hope this help you
 
                         [url removed]

          is all about 2d graphics  Wink clipping, grandients, tiles, textures, fonts, graphics, shapes, all 2d graphics examples

Don't link copyrighted material, please. / Markus
5  Game Development / Newbie & Debugging Questions / Re: Question: Variable name + integer on: 2008-03-30 18:07:43

  Well arrays  are exactly wath you need,
                                                   heres a example code:

                     public class Arrayer {

                                   private int number_Of_Numbers = 9;
                                   private int[] number = new int[number_Of_Numbers];    // or just new int[9]
 
                                                     for (int i; i < number_Of_Numbers; i++){
                                                                       number = i                                         // making the array number[0] = 0, number[1] = 1, etc
                                                         }
                                                                      //  so you can use them like
                                                                                  number[3] = 5;
                                                                                  number[2]++;
                                              }
   
 But arrays always starts with cero, so int[] array = new int[5], will make 5 ints starting with array[0] and ending with array[4]
you can make any object array, you can make Button[] Butt = new Button[4], making 4 buttons, and in the init method a for loop is used to initialize them - for(int r; r < 4, r++){ Button[r] = new Button("button"); Button[r].addActionListener(this); add(Button[r]); }
...

so your code will look like{

int[] var = new int[9];

       for(int i = 0; i < 9; i++)
{
    var = 1;                              // making all variables value 1
}
        then you will have  var[0], var[1], ........., var[9];

      Google for more Java arrays information Smiley
                      i Hope this helped you
6  Java Game APIs & Engines / Java 2D / Re: Collision Detection in simple 2D games on: 2008-03-23 22:04:48

   Well you can use simple bounding box collision detection, if you´re making a tetris game, every piece of tetris is made of rects
      for example a



                  Determining Intersections with Bounding Boxes

The easiest way to determine if two sprites intersect is by comparing their bounding boxes. A bounding box is the smallest rectangle, with edges parallel to the x and y coordinates, that contains the entire sprite.

Here’s a simple formula for determining if two sprites intersect. Let’s say that the smallest pair of coordinates of box 1 is (x1,y1), and the largest pair is (x2,y2). Similarly, box 2’s smallest coordinates are (x3,y3), and the largest are (x4,y4). Figure 5-11 shows these two boxes in the applet coordinate system. Box 1 intersects with box 2 if and only if the following condition is true:

(x2 >= x3) && (x4 >= x1) &&   // x-extents overlap

(y2 >= y3) && (y4 >= y1)      // y-extents overlap

Here’s another way of describing this equation. The x extent of a box is the range of x coordinates that the box occupies; y extents are defined analogously for y coordinates. The two boxes intersect if both their x extents and their y extents overlap. You can extend this intersection formula to three dimensions by testing whether the z extents also overlap

So this is the boolean you need  Wink

// compare bounding boxes
1  
2  
3  
4  
5  
6  
public boolean intersect(int x1,int y1,int x2,int y2) {

  return (x2 >= locx) && (locx+width >= x1)
    && (y2 >= locy) && (locy+height >= y1);

}


This routine checks if the sprite at (locx,locy), with the given width and height, intersects the bounding box between the coordinates (x1,y1) and (x2,y2).

so as example you can add a inspection rutine in the update method

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
public void update (Graphics g){

if(intersect(objective_x,objective_y,
                               objective_x+objective_h,objective_y+objective_w)){

                                  Puntos++;
                                  objective_x = Rndm_num(applet_width - objective_w);
                                  objective_y = Rndm_num(applet_height - objective_h);
                               }
. . . .
}


Now the only thing you have to do is implementing this boolean in your code and defining sets of Rects to each piece of tetris  Smiley

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.

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

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

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

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

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

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

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

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

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

CJLetsGame (190 views)
2014-04-01 02:16:10
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

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
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!