Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (522)
Games in Android Showcase (127)
games submitted by our members
Games in WIP (589)
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 03: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 00: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 01: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 16: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 16: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 21: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.

trollwarrior1 (23 views)
2014-11-22 12:13:56

xFryIx (69 views)
2014-11-13 12:34:49

digdugdiggy (48 views)
2014-11-12 21:11:50

digdugdiggy (42 views)
2014-11-12 21:10:15

digdugdiggy (36 views)
2014-11-12 21:09:33

kovacsa (60 views)
2014-11-07 19:57:14

TehJavaDev (63 views)
2014-11-03 22:04:50

BurntPizza (61 views)
2014-11-03 18:54:52

moogie (76 views)
2014-11-03 06:22:04

CopyableCougar4 (77 views)
2014-11-01 23:36:41
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!