Show Posts
|
|
Pages: [1] 2 3 ... 6
|
|
1
|
Discussions / General Discussions / Re: Not A Game!
|
on: 2012-08-10 17: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  ,... c&c tiberium sun on the pc
|
|
|
|
|
3
|
Game Development / Newbie & Debugging Questions / Re: help ! stuck with maths problem i think..
|
on: 2012-07-21 21: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++){ if(starsimage[i][a]==1){ test2[i][a]=0; int startX = i; 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
|
|
|
|
|
5
|
Game Development / Newbie & Debugging Questions / help ! stuck with maths problem i think..[SOLVED]
|
on: 2012-07-21 20: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  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 ?
|
|
|
|
|
8
|
Game Development / Newbie & Debugging Questions / Arrays.copyOf not working any help please ?[SOLVED]
|
on: 2012-07-19 12: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 20: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 17: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.
|
|
|
|
|
14
|
Game Development / Shared Code / Re: UPNP library
|
on: 2010-03-11 17: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 21: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  and seemyport couldnt see me 
|
|
|
|
|
16
|
Game Development / Shared Code / Re: UPNP library
|
on: 2010-03-09 20: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  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. EDITi 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 19: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-08 00: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
|
|
|
|
|
21
|
Discussions / General Discussions / Re: Applet and Webstart: The simple and proper tutorial.
|
on: 2010-02-22 19:37:21
|
download this... http://goldenstudios.or.id/products/utilities/jarmaker/index.phpi 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
| import com.golden.gamedev.Game; import com.golden.gamedev.GameLoader;
public class testgamelauncher extends GameLoader {
protected Game createAppletGame() {
return new bloodmoneyGameEngine(); }
} |
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 
|
|
|
|
|
26
|
Discussions / Miscellaneous Topics / Re: Wasting my life programming ?
|
on: 2009-12-29 20: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 17: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 17: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++ 
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|