Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (580)
games submitted by our members
Games in WIP (500)
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 / Game Mechanics / Re: Collisions between Planets[solved] on: 2013-09-09 23:11:07
thanks this is what I needed. I was near doing this, but was confusing the area/ mass with the diameter. Tongue
2  Game Development / Game Mechanics / Collisions between Planets[solved] on: 2013-09-09 22:46:48
For a 2d sprite simulation I have a grouping of different sized planets. Their size represents their mass. The each have a randomly generated color. When they collide I would like to mix the colors based on their mass, ie a small black + a big white should be slightly gray. How can I do this in a RGB system?
3  Game Development / Game Mechanics / Re: Collision detection with trochoids on: 2013-01-24 15:52:39
It's more about the collision response, I did basically an OBB check with out realizing it Grin
4  Game Development / Game Mechanics / Collision detection with trochoids on: 2013-01-24 07:42:30
I'm trying to do some really slick collision detection with pictures. Please try to follow my logic, it's not that clear, sorry.  Wink I want an image to bounce off the edge of the window, perfectly. Also, I want to understand how it does it, so I can later make 2 images interact.

basically, i realized all pictures are rectangles, and all a rectangle is is 4 points(or 4 lines).
If a rectangle is spinning, the corners move in a circle.
If a spinning rectangle is also moving it forms a trochoid(http://en.wikipedia.org/wiki/Trochoid)

I still need to figure out the equation for a trochoid moving in 2D, but once I do, collisions will be easy. just solve the equation for x or y, and set the other to a known value
(example: if the x of a point is greater than the boundary, y = f(x) and x = the boundary)

If anyone can point me in the right direction I would greatly appreciate it.
5  Game Development / Newbie & Debugging Questions / Re: [SOLVED]can someone help me fix this? on: 2012-12-19 02:55:59
sorry everyone, but I ended up rewriting the code, and it just worked. No idea why or where the error came from, but it's gone now(hopefully Wink)
6  Game Development / Newbie & Debugging Questions / Re: can someone help me fix this? on: 2012-12-19 02:21:43
there is an error I can get rid of or explain. It would be cool if someone could like at it and possibly tell me if I did something wrong. (this was pretty much a last resort, I have no idea what could be causing my error)

the problem is that occasionally words that use a certain letter and are valid will return false, but I can't find an pattern to it
(if you know how to play boggle)like any word that uses the e in the upper right corner is returns false

ps this was pretty much just a hail mary pass, I think something is wrong, but not with my code
7  Game Development / Newbie & Debugging Questions / [SOLVED]can someone help me fix this? on: 2012-12-18 23:24:40
I'm making the game boggle, and it works 95% of the time. but when it checks if a word is valid, occasionally it will 'forget' where one of the letters were. I can't figure out how or when it decides to mess up. could someone take a look at it?
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  
97  
98  
99  
100  
101  
102  
103  
104  
105  
106  
107  
108  
109  
110  
111  
112  
113  
114  
115  
116  
117  
118  
119  
120  
121  
122  
123  
124  
125  
126  
127  
128  
129  
130  
131  
132  
133  
134  
135  
136  
137  
138  
139  
140  
141  
142  
143  
144  
145  
146  
147  
148  
149  
150  
151  
152  
153  
154  
private boolean checkIfBuildable(String wordToCheck){
      Point[] lettersUsed = new Point[wordToCheck.length()];
      int letterToCheck = 0;
     
      while(true){
         boolean letterFound = false;
         
         if(letterToCheck == 0){
           
            //first letter, first time
           if(lettersUsed[letterToCheck] == null){
               for(int row = 0; row < letters.length; row++){
                  for(int col = 0; col < letters[row].length; col++){
                     
                     if(!letterFound){//we have to keep looking
                       if(wordToCheck.charAt(letterToCheck) == letters[row][col]){
                           
                           //it's found
                          lettersUsed[letterToCheck] = new Point(row, col);
                           letterFound = true;
                        }
                     } else {
                        break;//if letter is found, move to the next
                    }
                  }
               }
               
            //first letter, any time
           } else {
               for(int row = (int)lettersUsed[letterToCheck].getX(); row < letters.length; row++){
                  for(int col = (int)lettersUsed[letterToCheck].getY(); col < letters[row].length; col++){

                     if(!letterFound){
                        if(wordToCheck.charAt(letterToCheck) == letters[row][col]){
                           if(row > lettersUsed[letterToCheck].getX() ||
                                 (row == lettersUsed[letterToCheck].getX() && col > lettersUsed[letterToCheck].getY())){
                             
                              //it's found
                             lettersUsed[letterToCheck] = new Point(row, col);
                              letterFound = true;
                           }
                        }
                     } else {
                        break;//if letter is found, move to the next
                    }
                  }
               }
            }

         } else {
           
            //any letter, first time
           if (lettersUsed[letterToCheck] == null){
               for(int row = 0; row < letters.length; row++){
                  for(int col = 0; col < letters[row].length; col++){

                     if(!letterFound){
                        if(wordToCheck.charAt(letterToCheck) == letters[row][col]){
                           if(row > lettersUsed[letterToCheck - 1].getX() - 2 && row < lettersUsed[letterToCheck - 1].getX() + 2
                                 && col > lettersUsed[letterToCheck - 1].getY() - 2 && col < lettersUsed[letterToCheck - 1].getY() + 2){
                             
                              //check if repeated
                             boolean isRepeated = false;
                              for(int check = 0; check < letterToCheck; check++){
                                 if(lettersUsed[check].equals(new Point(row, col))){
                                    isRepeated = true;
                                 }
                              }
                             
                              if(!isRepeated){
                                 
                                 //it's found
                                lettersUsed[letterToCheck] = new Point(row, col);
                                 letterFound = true;
                              }
                           }
                        }
                     } else {
                        break;//if letter is found, move to the next
                    }
                  }
               }
               
            //any letter, any time
           } else {
               for(int row = (int)lettersUsed[letterToCheck].getX(); row < letters.length; row++){
                  for(int col = (int)lettersUsed[letterToCheck].getY(); col < letters[row].length; col++){
                     
                     if(!letterFound){
                        if(wordToCheck.charAt(letterToCheck) == letters[row][col]){

                           if(row > lettersUsed[letterToCheck - 1].getX() - 2 && row < lettersUsed[letterToCheck - 1].getX() + 2
                                 && col > lettersUsed[letterToCheck - 1].getY() - 2 && col < lettersUsed[letterToCheck - 1].getY() + 2){

                              if(row > lettersUsed[letterToCheck].getX() ||
                                    (row == lettersUsed[letterToCheck].getX() && col > lettersUsed[letterToCheck].getY())){
                                 
                                 //check if repeated
                                boolean isRepeated = false;
                                 for(int check = 0; check < letterToCheck; check++){
                                    if(lettersUsed[check].equals(new Point(row, col))){
                                       isRepeated = true;
                                    }
                                 }
                                 if(!isRepeated){
                                   
                                    //it's found
                                   lettersUsed[letterToCheck] = new Point(row, col);
                                    letterFound = true;
                                 }
                              }
                           }
                        }
                     } else {
                        break;//if letter is found, move to the next
                    }
                  }
               }
            }
         }
         
         
         
         //if we found the letter, we move on to the next one
        if(letterFound){
            if(letterToCheck > 0  && wordToCheck.charAt(letterToCheck - 1) == 'Q'){//if it's q
              lettersUsed[letterToCheck] = lettersUsed[letterToCheck - 1];//q and u have the same spot from qu
              letterToCheck++;
            }
           
            letterToCheck++;
                     
         } else {//we need to look for a different spelling
           lettersUsed[letterToCheck] = null;
           
            //if the letter is the u from qu, skip back to the q
           if(letterToCheck > 0 && wordToCheck.charAt(letterToCheck - 1) == 'Q'){
               letterToCheck--;
            }

            letterToCheck--;
         }

         //it's done
        if(letterToCheck >= wordToCheck.length()){
            return true;
         }

         //if we can't find the first letter, or can't find a valid combination
        if(letterToCheck <= -1){
            return false;
         }
      }
   }


ps. i hope this looks alright, i'm pretty new to this site
8  Discussions / General Discussions / Re: Spell checker dictionary for a game on: 2012-12-12 07:26:44
i had the same problem for a while, it depends on what your using. notepad, word, other text editors should work fine. eclipse or anything that else won't be able to handle it. try dividing up the data also, like certain letters in one file.
9  Discussions / Miscellaneous Topics / Re: Age is just a number.... on: 2012-12-12 05:51:04
I'm 18 and I loved java from the 1st "hello world"! also, why did this tread become about drugs and alcohol? not judging, just curious.
10  Discussions / General Discussions / Re: Spell checker dictionary for a game on: 2012-12-12 04:56:35
ra4king thank you so much! this is perfect! Grin
11  Discussions / General Discussions / Re: Spell checker dictionary for a game on: 2012-12-12 04:19:27
thanks for the suggestions, but I was actually look for a text file of some such. I guess I should have been clearer. I just don't want to have to rewrite the entire English language.
12  Discussions / General Discussions / Spell checker dictionary for a game on: 2012-12-12 03:42:12
I'm making the board game boggle, and have finished almost all the code portion. However, the one thing I am lacking is a a dictionary to see if a string is actually a word. Basically, i want to make a method that, given a string, will iterate through a text file and see if it is there. I have tried spell checkers like jazzy, and they are not what I want. If anyone would help me with this, that would be awesome.
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 (51 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (209 views)
2014-04-01 02:16:10
List of Learning Resources
by SHC
2014-04-18 03:17:39

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
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!