Java-Gaming.org Hi !
Featured games (83)
games approved by the League of Dukes
Games in Showcase (541)
Games in Android Showcase (133)
games submitted by our members
Games in WIP (603)
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 3 ... 10
1  Game Development / Newbie & Debugging Questions / uml class diagram for graph type system on: 2006-06-22 15:30:57
I am trying to figure out what a UML class diagram would look like for a system designed like a graph data structure.

The system is a series of relationships (R# is the relationship, A,B,C are the nodes):
R1 = A----B
R2 = B----C
R3 = A---B----C

In my case the relationships are the most important part. R1 can actually represent the relationship between a lot of nodes. But there is only one type of relationship R1. I am trying to come up with a UML diagram for such a system, and was wondering if anyone can give some advice to point me in the right direction.
2  Discussions / Miscellaneous Topics / new site name idea "codeandweed.com" on: 2006-05-19 19:19:01
What do you think Kev? a little too much Smiley
3  Java Game APIs & Engines / Java 2D / Re: clip an image on: 2006-05-19 13:03:23
Is that really better than clipping the area of the sprite sheet? performance wise? Hum.. I guess switching from one reference to another would be faster than constantly re clipping the same sprite.
4  Java Game APIs & Engines / Java 2D / Re: clip an image on: 2006-05-18 20:57:09
Hehe, its pretty big, 5 unique directions, 10 frames per direction, plus 1 direction with about 5 frames Smiley
5  Java Game APIs & Engines / Java 2D / Re: clip an image on: 2006-05-18 20:26:10
I get it now, but the thing is is that I will have a different clip range every other frame, so as to get the full animation (using a sprite sheet). So I guess i will stcik with the drawImage, since I need to reclip the image constantly, and getting the subImage sounds like it would create a new mage every time.


6  Java Game APIs & Engines / Java 2D / Re: clip an image on: 2006-05-18 20:11:50
Hi,
  You are trying to draw only the part of the image from (in image coords)
(0,0) to (someWidth -x , someHeight - y)

   You can use the method that woogley said.

1  
g.drawImage(someImage,x,y,someWidth, someHeight, 0,0,someWidth-x, someHeight-y,this);


  If the area of the destination rectangle is equal to the source rectangle, there is no scaling.
 
   Rafael.-



Ah ok I get it now.  What im trying to do is draw a frame out of my sprite sheet. Not sure if the best approach is the drawImage or getSubImage. Which one is better? My images are buffered.
7  Java Game APIs & Engines / Java 2D / Re: clip an image on: 2006-05-18 19:01:15
I looked at that, but all the drawImage methods seem to scale the image. A I missing something? Does one of the drawImage draws only a clipped portion of my Image? Which one is it?
8  Java Game APIs & Engines / Java 2D / clip an image on: 2006-05-18 17:51:26
Lets say I am doing all of my drawing to a graphics contect g, If I wish to draw a portion of an image I do the following:
1  
2  
3  
4  
5  
g.setClip(0,0,someWidth, someHeight);
g.drawImage(someImage, x,y, this);
g.setClip(0,0,screenWidth, screenHeight);
 
//continue normal draw operations here


This is how I currently acheive this, but was wondering why is there not a g.drawImage(image, x,y, clipping area, this) method, or is there?
9  Java Game APIs & Engines / Java 2D / Re: Shapes and collision detection with them on: 2006-05-01 18:12:09
Humm seems like a good place for my question. Lets say i wanted to do collision detection of a 2d polygon vs a rectangle (think Baldur's Gate if that means anything to anyone). What would be the best way of implementing that? do I declare my own polygon and then check to see if my rectangle intersects it anywhere? Or should I write my own based on techniques such as "decompisition through triangle coverings" <-- googled a paper about that, dont know what it is yet.
10  Game Development / Newbie & Debugging Questions / proteced access on: 2006-02-21 18:48:57
I am trying to use ArrayList's removeRange method but am getting the compile time error

"removeRange(int,int) has protected access in java.util.ArrayList"

How do I get around this? My code is just an instanciation ArrayList <Iteger> a = new ArrayList <Integer> (), and then a.removeRange(0, a.size())
11  Discussions / Miscellaneous Topics / need a really good java random number generator on: 2006-02-15 22:31:31
Hey gang, im trying to generate random numbers from 0 - 33 million. Random does a pretty poor job of it, wondering if anyone had or knows of a better java random number generator?
12  Discussions / Miscellaneous Topics / Re: what type of software is a game? on: 2006-02-06 20:24:55
Looked over the topics on gamedev. I understand the structure behind the game desig doc, but was wondering what other tools are used? I am guessing uml class diagrams that show object hierarchies, but what other design formats are helpful? I have done designs before for shopping carts and such, but have never designed/built a complete software system such as a game.
13  Discussions / Miscellaneous Topics / what type of software is a game? on: 2006-02-02 21:18:35
If someone was to put down on paper (uml I guess) the design of a simple platformer, what diagrams should be used. I have always had the trouble of figuring out how to document the different modules of a game and how they relate to each other. Any general suggestions?
14  Game Development / Newbie & Debugging Questions / help with reg expression on: 2006-01-31 22:37:43
I am trying to write a reg expression with the following rules:
Must start with a lower case letter, can have any characters in between EXCEPT NUMBERS, must end with a lower case letter

the expression I came up with is the following:
1  
[a-z]+([^0-9]*?)[a-z]+


the problem is that "section9" will yeild "section", and "se-ction9" will yeild "se-ction". But "se1ction9" will break it down into 2 mathces, "se" and "ction". How can I change my expression so that "se1ction9" is rejected completely?
15  Game Development / Newbie & Debugging Questions / Re: strange hashmap error on: 2006-01-30 20:02:01
ahh thank you. I see the issue now J Banes
16  Game Development / Newbie & Debugging Questions / strange hashmap error on: 2006-01-27 21:34:03
I created a little app that steps through a text file with binary values, counting the how many different sequences appear. The hashmap is set up so that the key is a binary string (ex: 110011) and the value is an int that gets incremented every time this sequence is found in the file. The weird error I am getting is that after I am done with my search, I got ot print out the results, but some of the binary strings have holes in them coming out of the hashmap. An example output looks like this:

key = :1000010000:
key = :1110011000:
key = :1010100000:
key = :0000001011:
key = :001001111 :
key = :1110011100:
key = :0000010111:
key = :1011110101:
key = :0000110111:

so some of the strings have missing 1's or 0's

My code can be found here: www.kommi.com/example.rar the input is the binary.txt and the output is the count.txt (everything is set up, just run the java file)

But there is nothing special about it here it is:

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  
Map<String, Integer> map = new HashMap<String, Integer>();
   
   String data;
   
   testCounter(String file)
   {
      data = loadFile(file);
   }
   
   private void runSequenceCount(int length, String output)
   {
      int start = 0;
      int end = length;
      Integer found;
      String sequence = "";
     
     
     
      while (end <= data.length() )
      {
         sequence = data.substring(start, end);
         
         found = map.get(sequence);
          
          
          
               if (found != null)
               {
                   map.put(sequence,found + 1);
                  
                  
               }
               else
               {
                   map.put(sequence,1);
               }
              
          
           end++;
           start++;
     
      }
   
      printMap(map, output);
     
           
   }
   
   public void printMap(Map aMap, String output)
   {
      int mapsize = aMap.size();
     
      StringBuffer res = new StringBuffer();
      Iterator keyValuePairs1 = aMap.entrySet().iterator();
     
      try
      {
         PrintWriter out = new PrintWriter(new FileWriter(output) );
         //set the iterator to point at length - limit
         for (int i = 0; i < mapsize; i++)
         {
             
              Map.Entry entry = (Map.Entry) keyValuePairs1.next();
              Object key = entry.getKey();
              Object value = entry.getValue();
             
              System.out.println("key = :" + entry.getKey() + ":");
              //res.append(key + " , " + value + "\r\n");
             
              out.println("key = :" + entry.getKey() + ":");
             
         }
     
      }
      catch (IOException e){ e.printStackTrace(); }
     
     
   }
   





17  Discussions / Miscellaneous Topics / about Word and PowerPoint formats on: 2006-01-26 20:44:42
As far as I know the structure of a Microsoft office file format is kept secret, meaning there is no way to pull the text out of a .doc file without knowing the exact structure of the doc file. The same goes for pulling images from a .ppt file. Is this an accurate assumption? If it is then I was wondering, how do zip archives turn a 20kb .doc file into a 2k zipped file? Did Microsoft specifically format it to be friendly to compression algorithms?

In the end, what I am trying to find out is whether or not it is possible to pull out the text data out of a .doc file or images out of a .ppt file. Is this possible?
18  Java Game APIs & Engines / Java 2D / Re: does the order matter druing a g.dispose() strat.show() on: 2006-01-24 15:23:33
// Repeat the rendering if the drawing buffer was lost
     } while (strategy.contentsLost());

under what circumstances can that occur?
19  Java Game APIs & Engines / Java 2D / does the order matter druing a g.dispose() strat.show() on: 2006-01-24 03:21:17
Does it matter at all what comes first? Is there a difference between:

g.dispose();
strategy.show();

and

strategy.show();
g.dispose();
20  Discussions / Miscellaneous Topics / how does google see article on: 2006-01-17 22:04:44
when I go to Google/News it brings up headlines and body of articles from all manner different sites around the web. I was wondering if anyone knew the technique behind this? How does google know where the headline is and where the article is on so many different sites, each with it's own formatting? Do all the sites have some kind of standardization for google, did they all rewrite their code so that google ca read them better? Any clues to this functionallity would be much appreciated.
21  Discussions / Miscellaneous Topics / Microsoft Live on: 2006-01-10 15:23:19
has anyone checked out the beta of this yet. I was playing around today and must admit the technology is pretty impressive, but seems to be mostly for novelty. Still, I never knew you can get that kind of functionality with .NET. If this is what they plan on using to gain a larger share of the search market, then they might easily succeed, at least in the non corporate sector. Any thoughts?
22  Discussions / Miscellaneous Topics / Re: anything better to use than a StringBuffer on: 2006-01-09 18:42:58
ah ok, so I have a hash map with all of the locations of all the words. That way I dont have to do an indexOf operation. Then just use the StringBuffer object to compare against my seach string, checking at each location of the first word. Got it, thanks.
23  Discussions / Miscellaneous Topics / Re: anything better to use than a StringBuffer on: 2006-01-09 16:42:43
Hum Jeff I am interested in trying the approach you are talking about. Lets say I store the following paragraph into a hash table (paragraph out of random cnn article)

"Iran's nuclear programs are a source of contention with the West. Iran's hard-line conservative government insists the programs are aimed at peaceful purposes, and that it has the right to restart nuclear facilities and enrich uranium for the production of nuclear energy."

How exaclty should I store it in a hash table? I am guessing the id of each word is just the word number in the paragraph.

How would I search for a sentence in a hash table? I am guessing I get all the id's for all the words and check to see if they are next to each other? Is that really going to be faster than an indexOf operation?
24  Discussions / Miscellaneous Topics / anything better to use than a StringBuffer on: 2006-01-06 16:55:10
Hey I have a small app that constantly searchers through a dataBuffer looking for words and sentenses. One operation would be to get the location of the 20th occurance of the word 'the'. I was wondering if there is a better structure to use rather than a stringBuffer. Maybe some kind of Hash structure? Since the buffer is large, the indexOf() operations takes time to execute, and I am trying to improve the performance. Anyone have any suggestions?
25  Game Development / Newbie & Debugging Questions / Re: please review design on: 2005-12-29 20:10:15
Yes, that's good! Whatever you do for the "Core Logic", keep it separate from the GUI. The "Core Logic" should know nothing about the GUI.

However, the GUI holds an instance of the "Core Logic". You can update the GUI in two ways:
-Poll the "Core Logic" e.g. every 50ms  and update the view if something changed (->not so good lot of overhead)
-Push method:
  1. Add to "Core Logic":
        addChangeListener(...)
        removeChangeListener(...)
        fireChange(...)
     Changes are sent from the "Core Logic" to all registered listeners.
  2. Register the GUI as listener for changes in the "Core Logic"

1. and 2. keep GUI and "core logic" separate: MVC pattern

Cool definatly will give the Listener approach a go
26  Game Development / Newbie & Debugging Questions / Re: please review design on: 2005-12-28 20:38:27
Yes the MVC pattern is definatly the way to go, I am seeing that more and more now.
27  Discussions / Miscellaneous Topics / Re: something is up with my compiler.... on: 2005-12-28 15:37:37
Thanks, solved both issues.
28  Game Development / Newbie & Debugging Questions / Re: please review design on: 2005-12-28 15:31:02
My intial confusion was just how to properly attach a GUI to a Core Logic module that I built. I did want the ability to extensively modify the GUI or plug in a different one, without modding the Core Logic. Also, the Core Logic was suppose to return data to the GUI. I kind of figured that having the Core Logic hold a ref to the GUI and the GUI holding a ref to the Core Logic was bad design.
29  Discussions / Miscellaneous Topics / something is up with my compiler.... on: 2005-12-28 02:39:16
Ok it is kind of a weird issue, and this does not happen to me at work. But at home when I compile a file, for some reason the compiler creates 2 class files, the correct one, and a smaller one with the same name but a $1 at the end. So If I compile the file test.java, I get test.class and test$1.class. The other issue is that if I have a file that is in a package, and I compile this file from outside my IDE (Jcreator) for some reason the package (directory) does not get created. Does anyone know why this happens? I was messing around with classpath vars not too long ago, could that have something to do with it?
30  Discussions / Miscellaneous Topics / jprobe output question on: 2005-12-27 22:20:28
OK I ran my app through Jprobe and am a little confused about a few things. I am wondering that if I have a while loop that calls StringBuffer.indexOf() a ton of times how come the jprobe count is so low?

You can view an html of jprobe results sorted by amount of calls here http://www.kommi.com/mostcalls.html

Also if you look at the amount of time sort here http://www.kommi.com/mostcalls.html, you will notice that the 4 main methods take up a lion share of the  time, but all those methods are loops that constantly search massive Stringbuffer ojects. I also have lots of my own Objects being instanced all the time. How come non of those things appear? How an I missinterperting the JProbe result set?
Pages: [1] 2 3 ... 10
 

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

The first screenshot will be displayed as a thumbnail.

Mr.CodeIt (10 views)
2014-12-27 04:03:04

TheDudeFromCI (13 views)
2014-12-27 02:14:49

Mr.CodeIt (25 views)
2014-12-23 03:34:11

rwatson462 (56 views)
2014-12-15 09:26:44

Mr.CodeIt (46 views)
2014-12-14 19:50:38

BurntPizza (92 views)
2014-12-09 22:41:13

BurntPizza (113 views)
2014-12-08 04:46:31

JscottyBieshaar (83 views)
2014-12-05 12:39:02

SHC (94 views)
2014-12-03 16:27:13

CopyableCougar4 (102 views)
2014-11-29 21:32:03
Resources for WIP games
by kpars
2014-12-18 10:26:14

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