Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (497)
Games in Android Showcase (114)
games submitted by our members
Games in WIP (563)
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 ... 6
1  Discussions / General Discussions / Re: Not A Game! on: 2012-08-10 15:08:28
newest good game would be read dead redemption on the ps3, brilliant game, other good games going back in time would be...   tir-na-nog on the spectrum, ik+ on the amiga, syndicate wars on the ps1, civ 1 on the pc. it seems to me as graphics became better they seem to forget about the gameplay, oh and startrek armada on the pc  Grin,... c&c tiberium sun on the pc
2  Game Development / Newbie & Debugging Questions / Re: help ! stuck with maths problem i think.. on: 2012-07-23 11:08:49
I sort of understand it, if an iterator is not required, use that form because its faster, but that would mean changing pages of code  Shocked, may be i will experiment next year with it , as im too wrapped up in the  understandings of adding user defined classes into linkedlists and manipulating the contents..so much to learn !!
3  Game Development / Newbie & Debugging Questions / Re: help ! stuck with maths problem i think.. on: 2012-07-21 19:56:48
YES exactly like that , now to sift through your program to pick out the maths bit, thank you !!

update..

typical..it wasnt the maths after all, i was that thing when you get variable interference from somewhere else in the program, i was zeroing out a 2d array just before my loop started i put it after the array had found a pixels and hey presto it worked, btw thats some weird for loop you use, that form scares me because i dont understand it..haha

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
   public void imageupdate(){
   
         bimage.createGraphics();  
         int rgb;
         
         for (int i=0; i<800; i++) {
            for(int a=0;a<500;a++){
                  //test2[i][a]=0;    /// /<-----this was the culprit
              if(starsimage[i][a]==1){
                  test2[i][a]=0;
                  int startX = i;   //// <-no wonder it didnt work
                 int startY = a;
                       
                                 
                     int dx = 400 - startX;
                     int dy = 250 - startY;


See folks thats what happens if a newbie takes 2 years out of programming
4  Game Development / Newbie & Debugging Questions / Re: help ! stuck with maths problem i think.. on: 2012-07-21 19:08:35
Thanks, but that still just produces half an image on the left hand side going out, theres no right hand side pixels at all

update.. if you change the sign at the bottom 2 statements to positive the right hand side pixels cave in to the centre of the screen and the pixels on the right hand side dont show at all  persecutioncomplex

5  Game Development / Newbie & Debugging Questions / help ! stuck with maths problem i think..[SOLVED] on: 2012-07-21 18:25:35
hey everyone, i am stuck and rapidly running out of ideas with my maths problem, any pointers would be great..

consider the following... a screen is filled with random pixels the following code only half works and i have tried everything i can think of to get it working but i am at a loss. the pixels on the left hand side move outwards at an angle from the center of the screen,,,perfect just what i am looking for..
but the pixels on the right hand side when i alter the code do the following go in to the center...dont move at all(code on show) or dont even show Huh



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  
                  int startX = i;
                  int startY = a;
                  int dx = 0;
                  int dy = 0;
                  int endX=0;
                  int endY=0;
                 
                  if(startX <=400){
                  dx = 400 - startX;dy = 250 - startY;
                 
                 
                  double distToTarget = Math.sqrt(dx * dx + dy * dy);
                  double ratio = 5/ distToTarget ;

                 
                  endX = startX - (int)Math.round(ratio * dx);
                 
                  endY = startY - (int)Math.round(ratio * dy);
                  }        
                  if(startX >=400){
                  dx = 400 - startX;dy = 250 - startY;
                 
                 
                  double distToTarget2 = ((dx * dx + dy * dy)*2);
                  double ratio2 = 5/ distToTarget2 ;

                 
                  endX = startX + (int)Math.round(ratio2 * dx);
                 
                  endY = startY + (int)Math.round(ratio2 * dy);
                  }


what am i missing ?
6  Game Development / Newbie & Debugging Questions / Re: Arrays.copyOf not working any help please ? on: 2012-07-19 20:27:11
Doesn't

System.arraycopy(...);

just do a shallow copy of the reference to the array and not the array objects ?

as this array copy has to be done continuously i think i may well be working on this problem longer than i expected.
7  Game Development / Newbie & Debugging Questions / Re: Arrays.copyOf not working any help please ? on: 2012-07-19 16:44:57
Thank you kindly Sir, i thought it must be some thing i had done, i just couldn't see the wood for the trees.
8  Game Development / Newbie & Debugging Questions / Arrays.copyOf not working any help please ?[SOLVED] on: 2012-07-19 10:04:26
Hi, im having a problem with trying to deep copy or even shallow copy an array, i have tried nearly every single code sample on the web nothing works what am i missing ?

assuming i have already created 2 new arrays and filled 1 with ints

1  
2  
3  
4  
5  
      int[][] test = new int[test2.length][test2[0].length];

                for (int i=0; i <test2.length; i++) {
            test[i] = Arrays.copyOf(test2[i],test2[i].length);
                }


full code

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  
import java.util.*;


public class test_copyarray {

   public static int test[][] = new int[4][4];
   public static int test2[][] = new int[4][4];
   
    public static void dotest(){
   
      for(int i = 0;i<4;i++){
         for(int j = 0;j<4;j++){      
            System.out.println("test = "+test[i][j]);
         }
      }  
   }
    public static void copytest(){
   
      int[][] test = new int[test2.length][test2[0].length];
        for (int i=0; i <test2.length; i++) {
         test[i] = Arrays.copyOf(test2[i],test2[i].length);
        }

   }  
   
    public static void dotest2(){
   
      for(int i = 0;i<4;i++){
         for(int j = 0;j<4;j++){
            test2[i][j]=i;
            System.out.println("test2 = "+test2[i][j]);  
         }
      }  
   }  
   
    public static void dotest3(){
   
      int c=10;
      for(int i = 0;i<4;i++){
         for(int j = 0;j<4;j++){      
            test2[i][j]=c++;
            System.out.println("test3 = "+test2[i][j]);        
         }
      }  
   }  
   
    public static void dotest4(){
   
      for(int i = 0;i<4;i++){
         for(int j = 0;j<4;j++){        
            System.out.println("test4 = "+test[i][j]);
         }
      }  
   }

   public static void main(String args []) {
   
      dotest();
      dotest2();
      System.out.println("copying test2 to test");
      copytest();
      dotest();
      System.out.println("changing data in test 2");
      dotest3();
      System.out.println("copying test2 to test");
      copytest();
      dotest4();
               
     
   }
   

}


any pointers would be great thank you

9  Discussions / General Discussions / Re: Odd and original game-design ideas on: 2012-07-18 18:39:20
I once made a game with fps creator and made it so you had to shoot a portable toilet through a hole in the scenery, you only had limited amounts of ammo, and the objects were super light weight as the levels increased the holes got smaller..haha great game shame it wont install on my new computer
10  Game Development / Newbie & Debugging Questions / Re: applet downloading media on: 2010-04-28 15:31:15
I may be off the mark when i say this but from my experience i used the approach... players run the applet on thier computers then if its signed you can create a directory for your game and download what you like into it(images,music etc).my sprites were massive 10mb each and i didnt want a player to download them every time they ran it. you can check the date of file creation so if its newer then it will download it off the server if not it skips it, of course all this is done in the background at a time when performance doesnt matter.
11  Game Development / Newbie & Debugging Questions / Re: Package question on: 2010-04-24 07:21:02
Notepad++ Rules...!
I use it when i program.
12  Game Development / Networking & Multiplayer / Re: User registration and logins on: 2010-03-25 16:49:15
Sorry i had to ask, if you require login details via a webpage and theres an applet running on it. why not just enter the details via the applet??
13  Game Development / Newbie & Debugging Questions / Re: A little hand to the absolute newby? on: 2010-03-18 19:48:33
Theres a few to choose from.. i Personally use GTGE
www.goldenstudios.or.id
theres quite a few small samples to get you up and running in no time. i found it really easy to understand as i learned it at the same time i started learning java.
It might not be as powerfull as some other game api's but its a good starting point to learn the basics(sprites, sound, etc etc).
14  Game Development / Shared Code / Re: UPNP library on: 2010-03-11 16:35:42
ok heres the new output file. it added it then it took it away, btw im running on virgin media 10mb cable connection with a Netgear WGR614v9 wireless router. i havent managed to write any code to test out the mapping yet i was wanting to get round to it tonight..
15  Game Development / Shared Code / Re: UPNP library on: 2010-03-09 20:30:42
This is the output i got...

EDIT

IT does add an entry and removes it succesfully but it doesnt touch port forwarding..looks to me like it just adds the port mapping Huh

and seemyport couldnt see me  Roll Eyes
16  Game Development / Shared Code / Re: UPNP library on: 2010-03-09 19:42:13
LOL it was a belkin router it always played up sometimes it would let me login, other times it wouldnt i thought it was because i was running my web server but it was just a rubbish router i have setup my new netgear router and the test code is working perfect again  Grin

But it wont add a port (invalidAction error)theres too many parameters for the netgear

on netgear you need...

Whats it called ?
what type ?
start port ?
end port?
local address ?

going to have a look at the docs see if i can work it out.

EDIT

i took out these lines..
1  
2  
         int nummaps = dev.getNatMappingsCount();
         System.out.println("nummaps = "+ nummaps);


and it succesfully added an entry in the upnp section
17  Game Development / Shared Code / Re: UPNP library on: 2010-03-09 18:19:55
My problem is my router i cant even login to the admin web interface to see whats going on..i have a brand new netgear wireless router to test see if that makes any difference.
18  Game Development / Shared Code / Re: UPNP library on: 2010-03-07 23:28:27
Disaster strikes when i try to run the program on my xp machines on the same network

this is my test code..
I imported all the classes but it didnt make a difference
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
import net.sbbi.upnp.*;
import net.sbbi.upnp.impls.*;
import net.sbbi.upnp.devices.*;
import net.sbbi.upnp.services.*;
import net.sbbi.upnp.messages.*;

public class test{

   public static void main(String [] args){
   
      try{
     
         InternetGatewayDevice dev = InternetGatewayDevice.getDevices( 1000 )[ 0 ];
         String thisWillBeHandy = dev.getExternalIPAddress();
         System.out.println(thisWillBeHandy);
      }
     
      catch(Exception a){
     
         System.out.println("oh oh");              
      }  
   }
}



1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
21  
22  
23  
24  
java.net.SocketException: Connection reset
        at java.net.SocketInputStream.read(Unknown Source)
        at java.io.BufferedInputStream.fill(Unknown Source)
        at java.io.BufferedInputStream.read1(Unknown Source)
        at java.io.BufferedInputStream.read(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTPHeader(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
        at sun.net.www.http.HttpClient.parseHTTP(Unknown Source)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
        at java.net.URL.openStream(Unknown Source)
        at net.sbbi.upnp.XMLUtil.getXMLString(XMLUtil.java:97)
        at net.sbbi.upnp.XMLUtil.getXML(XMLUtil.java:134)
        at net.sbbi.upnp.devices.RootDevice.build(RootDevice.java:119)
        at net.sbbi.upnp.Discovery$1.discoveredDevice(Discovery.java:243)
        at net.sbbi.upnp.DiscoveryListener.listenBroadCast(DiscoveryListener.java:369)
        at net.sbbi.upnp.DiscoveryListener.run(DiscoveryListener.java:241)
        at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
        at net.sbbi.upnp.XMLUtil.getXML(XMLUtil.java:135)
        at net.sbbi.upnp.devices.RootDevice.build(RootDevice.java:119)
        at net.sbbi.upnp.Discovery$1.discoveredDevice(Discovery.java:243)
        at net.sbbi.upnp.DiscoveryListener.listenBroadCast(DiscoveryListener.java:369)
        at net.sbbi.upnp.DiscoveryListener.run(DiscoveryListener.java:241)
        at java.lang.Thread.run(Unknown Source)


i am using the jre 6 update 15 i will try again after i have updated to the latest
19  Game Development / Shared Code / Re: UPNP library on: 2010-03-07 11:11:54
it successfully added a port forward  to my router config (belkin 54g cable modem router).
20  Game Development / Shared Code / Re: UPNP library on: 2010-03-07 00:26:54
OMG i Got it To Compile it works  Grin

Ive been trying for ages to get this to work !

now its time to experiment  Grin Thanks a million !
21  Discussions / General Discussions / Re: Applet and Webstart: The simple and proper tutorial. on: 2010-02-22 18:37:21
download this...

http://goldenstudios.or.id/products/utilities/jarmaker/index.php

i found it easy to setup and use..just fill in the required fields...it will create a jar and it can sign it too.you supply your own keys



this is my .jnlp file on my server , change the names to reflect your file names

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  
<?xml version="1.0" encoding="utf-8"?> 

<jnlp
  spec="1.0+"
  codebase="http://kickassevolution.com/bm3source/webstart"
  href="kae.jnlp">
  <information>
    <title>KickAssEvolution's BloodMoney</title>
    <vendor>Mark Mistry</vendor>
    <homepage href="bm3source/webstart/index.html"/>
    <description>Free Multiplayer Online Fighting Game. KickAssEvolution'
s BloodMoney</description>
    <description kind="short">BloodMoney</description>
   
    <offline-allowed/>
  </information>
  <security>
  <all-permissions/>
  </security>
  <resources>
    <j2se version="1.6+"initial-heap-size="256m" max-heap-size="512m"/>
 
    <jar href="kae.jar"/>
  </resources>
  <application-desc main-class="bloodmoneyGameEngine"/>
</jnlp>



add this code to your index.html file or whatever .php etc etc

1  
2  
3  
4  
5  
6  
<TD> <applet code="testgamelauncher.class"
   archive="kae.jar"
   width="800" height="600">
<PARAM name="java_arguments" value="-Xmx512m">
</applet></TD>
<TD>


i use the gtge framework/api /library thing so i need this class file

1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
// GTGE
import com.golden.gamedev.Game;
import com.golden.gamedev.GameLoader;

public class testgamelauncher extends GameLoader {

    protected Game createAppletGame() {

        return new bloodmoneyGameEngine();
        //this is the name of my class with main method

    }

}


if you want your applet or jnlp to access your server


1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
17  
18  
19  
20  
grant codeBase "http://www.kickassevolution.com/-" {

  permission java.io.FilePermission
 "coreservers.html", "read";
   permission java.io.FilePermission
 "gameservers.html", "read";
    permission java.io.FilePermission
 "highscores.html", "read";
   permission java.io.FilePermission
 "build.html", "read";
   permission java.io.FilePermission
 "chars.html", "read";
    permission java.io.FilePermission
 "missions.html", "read";
     permission java.io.FilePermission
 "trophys.html", "read";
      permission java.io.FilePermission
 "moves.html", "read";
 permission java.util.PropertyPermission "user.home", "read","write";
};



and in my abyss webserver config file i added these lines so it would know what a .jnlp file was...


1  
2  
3  
4  
5  
6  
7  
8  
         <mime>
            <ext>
               jnlp
            </ext>
            <type>
               application/x-java-jnlp-file
            </type>
         </mime>


all this info i found on google it took me a few days to find all the info and a few days to get it to work properly..good luck  Grin
22  Discussions / General Discussions / Re: anti-virus spam in my personal messages here on: 2010-02-20 17:23:20
we just have to wait till they get bored and go bother someone else  Roll Eyes Roll Eyes
23  Game Development / Networking & Multiplayer / Re: Multithreading with java.io on: 2010-02-20 17:19:39
you could try the java tutorials...

http://java.sun.com/docs/books/tutorial/networking/sockets/index.html

this is a great place to start and you,ll have a chat program written in no time.
24  Games Center / Archived Projects / Re: My first multiplayer internet fighting game(GTGE) applet and jar on: 2010-02-19 23:07:47
well its been more than 3 months and i have decided to pick up where i left off..
I have scrapped the single player mode the ai was too difficult . i am looking for performance testers now as my connection should now be 10meg...
25  Game Development / Networking & Multiplayer / Re: is asking for port forward too much? on: 2010-02-02 21:36:27
are you looking for java pnp to set the router to port forward?
check this out...
http://www.sbbi.net/site/upnp/index.html

and when you get a test working give me a shout and i will be your best friend  Grin
looks like it will get rid off port forward problems but as the others suggest youll still need some sort of rendezvous server to keep a list of all the connected servers.
ive lost the will to program so youll have to do it  Grin
26  Discussions / Miscellaneous Topics / Re: Wasting my life programming ? on: 2009-12-29 19:34:24
Its only a waste if you personally think its a waste.

I have enjoyed my little journey into the world of java and games programming, although i was addicted to it i have learned to keep things more balanced.

I now spend quality time with my wife when i am not working, but i cant help but thinking of how i could improve my methods and speed up certain parts of my game which i have totally ripped apart ready for round 2 in march (when wife goes back to work and she stops moaning that i spend every single second programming and learning..lol).

Have i wasted all my time learning java ?...No i am a little wiser and i learned how to do things in moderation.

No matter what you do in life, even if nothing comes from it other than entertainment its never a waste of time :O)
27  Game Development / Newbie & Debugging Questions / Re: Java read/write to a text file on my site for highscores on: 2009-10-08 15:30:47
I dont know if this is the best way to do things but it worked for me.
i have a plain text file on my server for highscores, clients(applets and applications) can access this file(readonly).
they either do it directly using the http protocol or they can do it by passing a message to the java server application requesting the highscore data.
when it comes to updating the highscore they pass another message to the server application,the server application verifies the username and password and will update the file(i acually update a mysql database and get the server to periodically overwrite the text file).
so the clients access the file on the server by requesting the data from a java application on the server.
to display the data on the website i used php to read from the text file and display it.
I never let my clients alter files on my server directly they always have to verify themselves to a java application.
Word of warning if you try to do too many http calls too quickly your server will think its under a denial of service attack and you wont be able to read anything.
28  Java Game APIs & Engines / Tools Discussion / Re: which compiler (/IDE)? on: 2009-09-08 15:19:36
i couldnt even figure out how to set up a project,
 too many big words and too many buttons that i have no idea what they are on about, i am great at figuring out what i did wrong when it comes to my program not working and i can normally tell if its not going to compile properly but i like to see what effect its going to have anyway..its the way i learn i guess.i will stick with notepad++  Smiley
29  Java Game APIs & Engines / Tools Discussion / Re: which compiler (/IDE)? on: 2009-09-07 13:36:56
I use notepad ++ for everything.
 ide's are for lazy ppl that dont like to type  Grin.
Im only jealous cause i dont know how to use them .lol
30  Game Development / Networking & Multiplayer / Re: How to make a sever in java run on a website? on: 2009-08-31 11:11:37
not had chance to test on large scale but seems to be coping quite well with a few connections.
limitations is being on a slow 10mb connection rather than on a 100mb connection.
if you have enough computers maybe a seperate machine for webserver and seperate machine for game/chat server
Pages: [1] 2 3 ... 6
 

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

The first screenshot will be displayed as a thumbnail.

BurntPizza (19 views)
2014-09-19 03:14:18

Dwinin (34 views)
2014-09-12 09:08:26

Norakomi (62 views)
2014-09-10 13:57:51

TehJavaDev (84 views)
2014-09-10 06:39:09

Tekkerue (42 views)
2014-09-09 02:24:56

mitcheeb (64 views)
2014-09-08 06:06:29

BurntPizza (47 views)
2014-09-07 01:13:42

Longarmx (35 views)
2014-09-07 01:12:14

Longarmx (39 views)
2014-09-07 01:11:22

Longarmx (36 views)
2014-09-07 01:10:19
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

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
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!