Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (581)
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] 2 3 ... 6
1  Game Development / Newbie & Debugging Questions / Re: mouse event not triggering on: 2014-04-19 15:46:10
it seemed that when i implement MouseListener to the JPanel it doesnt ADD the listener by itself.
so i added an inner class which extends MouseAdapter (with all the event code), then set the listener in the constructor of the jPanel
it did the wrk Smiley Smiley Smiley

Since you implemented the MouseListener to the JPanel itself, you could just have done this:
addMouseListener(this);

But I'm glad you were able to fix it Smiley
2  Game Development / Newbie & Debugging Questions / Re: mouse event not triggering on: 2014-04-19 13:15:01
You should put the Mouse(Motion)Listener in the (constructor of) JPanel (PuzzlePanel in this case)

setMouse(Motion)Listener(Mouse(Motion)Listener listener);
3  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-11 17:32:47
Congratz @Herjan for being top of the current official leaderboard!

Yeah, finally people respect me for my work! (joke) I'm so pathetic Smiley
But it feels good, nonetheless. And moogie is second! (One wolf difference,  Kiss)

Pizza, I see you have uploaded your 'Spywolf', he has a nice score as well (top 5)!

And BTW:
Quote
You should really fear Hybrid, it's nearly unstoppable.
I just thought of a funny way to learn him a lesson, see my comment on his wolf Tongue
4  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-10 19:39:25
Haha, I like the contest, but I dont think I can make a much better wolf. You can never dodge the moments that you move to the left and another wolf/lion jumps to the right.
The best-performing wolves are all super close so that confirms it, I think. I'm still waiting for the updated scoreboard with my wolf to pop up, and that new DeepWolf looks promising btw.

But I wish you lots of luck with the Omega successor!
I will see it soon enough on one of the forums, be sure to surprise me with your coming ImmortalInvincibleWolf Tongue
5  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-10 14:36:20
Ofcourse I can explain.

Here is my lionproof strategy:
1  
2  
3  
4  
Check the topleft corner [0][0] so I know there is a lion coming next turn.
What I also do is check [1][0] so if there is a lion (if it was not in the topleft corner) I know it is going to [2][0] (down) and after that to [2][1] (right)
(and with the right side I do the same [0][1] to [0][2] to [1][2]).
So if the lion is going [2][1] my wolf will be sure  not to go down.


Had to put it in code because of this
  • [1]

And that's the main secret Tongue
The wolf-dodging tactic is pretty standard though, so I don't have a lot to say about that. (Just calculating dangers)
6  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-09 19:59:24
Averages of 100 rounds, 1000 iterations:

Just my wolf and the standard mobs:
1  
2  
3  
4  
class animals.Bear - 2.2600002
class animals.Lion - 41.21
class animals.Stone - 20.159998
class animals.HerjanWolf - 99.99 <-- kind of flawless


Small Wolfgroup:
1  
2  
3  
4  
5  
6  
class animals.Bear - 1.0700002
class animals.Lion - 31.29
class animals.Stone - 23.97
class animals.HerjanWolf - 99.44999 <-- Who's boss
class animals.AlphaWolf - 92.83001
class animals.OmegaWolf - 98.55


Big Wolfgroup:
1  
2  
3  
4  
5  
6  
7  
8  
9  
10  
11  
12  
13  
14  
15  
16  
class animals.Bear - 0.11
class animals.Lion - 0.0
class animals.Stone - 3.21
class animals.AlphaWolf - 82.96001
class animals.HerjanWolf - 74.56999 <-- My score really sucks here though
class animals.GatheringWolf - 57.6
class animals.OmegaWolf - 88.36 <-- This one wins every game on this scale -.- Awesome moogie!
class animals.ShadowWolf - 79.83001
class animals.MOSHPITFRENZYWolf - 5.9399986
class animals.WolfWithoutFear - 11.209999
class animals.MimicWolf - 0.7
class animals.LazyWolf - 73.68999
class animals.Sheep - 41.72
class animals.HonorWolf - 81.91999
class animals.CamperWolf - 70.85998
class animals.GamblerWolf - 34.02999


My Wolf:
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  
155  
package animals;

public class HerjanWolf extends Animal {
   
    private boolean lionTopLeft = false, lionTopLeftReady = false;
    private boolean lionRight = false, lionRightReady = false;
    private boolean lionBot = false, lionBotReady = false;
    private boolean lionDanger = false, careful = true, firstmove = true;
    private final int down = 1, right = 2, left = 3, up = 4;
   
    public HerjanWolf() {
        super('W');
    }
   
    public Attack fight(char c){
        switch (c) {
            case 'B':
                return Attack.SCISSORS;
            case 'L':
                return Attack.SCISSORS;
            case 'S':
                return Attack.PAPER;
            default:
                int rand = (int) (Math.random()*3);
                if(rand < 1)
                    return Attack.PAPER;
                else if(rand < 2)
                    return Attack.SCISSORS;
                else
                    return Attack.ROCK;
        }
       
    }
    public Move move() { //surroundings[y][x]
       
        checkLions();
       
        if(firstmove){
            if(surroundings[2][0] == 'L')
                lionBotReady = true;
            if(surroundings[0][2] == 'L')
                lionRightReady = true;
            firstmove = false;
        }
       
        if(lionDanger || surroundings[1][0] == 'L' && lionTopLeftReady || surroundings[0][1] == 'L' && lionTopLeftReady){
           
            if (isSafe(1, 2) && surroundings[0][2] != 'W'){
               newMove(right);
               return Move.RIGHT;
            }else if (isSafe(2, 1)){
               newMove(down);
               return Move.DOWN;
            }else if (isSafe(0, 1)){
               newMove(up);
               return Move.UP;
            }else if (isSafe(1, 0)){
               newMove(left);
               return Move.LEFT;
            }else if(isSafe(1,2)){
               newMove(right);
               return Move.RIGHT;
            }
           
            newMove(left);
            return Move.LEFT;
        }
   
        return Move.HOLD;
    }
   
    boolean isSafe(int y, int x){
        if(y <= 1){
            if(x <= 1){
                if(surroundings[y][x] != 'W' && !lionTopLeft)
                    return true;
            }else if(surroundings[1][2] != 'W' && !lionRightReady)
                    return true;
        }else if(surroundings[2][1] != 'W' && !lionBotReady)
            return true;
       
        return false;
    }
   
    public void checkLions(){
        int y = 0, x = 0;

        if(lionTopLeft)
            lionTopLeftReady = true;
        else
            lionTopLeftReady = false;

        if(surroundings[y][x] == 'L')
            lionTopLeft = true;
        else
            lionTopLeft = false;

        if(lionRight)
            lionRightReady = true;
        else
            lionRightReady = false;

        if(surroundings[y][x+1] == 'L') // && !lionTopLeftReady
           lionRight = true;
        else
            lionRight = false;

        if(lionBot)
            lionBotReady = true;
        else
            lionBotReady = false;

        if(surroundings[y+1][x] == 'L' && !lionTopLeftReady)
            lionBot = true;
        else
            lionBot = false;
       
        if(careful){
            if(surroundings[y+1][x] == 'L'){
                lionDanger = true;
            }else if(surroundings[y][x+1] == 'L'){
                lionDanger = true;
            }
                   
            careful = false;
        }
    }
   
    public void newMove(int move){
        lionTopLeft = false;
        lionRight = false;
        lionBot = false;
       
        lionTopLeftReady = false;
        lionRightReady = false;
        lionBotReady = false;
       
        lionDanger = false;
       
        if(move == down){
            if(surroundings[1][0] == 'L')
                lionTopLeft = true;
            if(surroundings[2][0] == 'L')
                lionBot = true;
           
        }else if(move == right){
            if(surroundings[0][1] == 'L')
                lionTopLeft = true;
            if(surroundings[0][2] == 'L')
                lionRight = true;
           
        }else
            careful = true;
    }
}


Again thanks for telling me about this Pizza, it was fun!

EDIT:
At the main topic where my wolf is posted I updated my wolf a little bit so that it has an avg of 85+ in large groups.
7  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-08 22:58:08
Ok, how far I got this hour:

100 rounds, 1000 iterations:
class animals.Bear - 0.47000003
class animals.Lion - 30.09
class animals.Stone - 22.06999
class animals.AlphaWolf - 92.88
class animals.HerjanWolf - 98.41002
8  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-08 21:50:32
Oh yeah I read it, but if he keeps up with the scores, doesn't he have a download for the game with all the current wolves (in the scoreboard) for us then?
I btw hate it that I got an error in eclipse but in netbeans it worked just fine (in the Game class a xxx.add(new ArrayList) error twice...) I have JRE 8 in both of the IDEs (newest eclipse 4.4.2-M6 which is compatible with Java Cool
9  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-08 21:02:42
But will it ever be your wolves vs other peoples wolves then?
I thought he measured the scores with only Lions, Bears, Stones (and normal Wolves or not?)?
10  Discussions / General Discussions / Re: "Multiplayer" AI challenge on StackExchange right now: Create Your Wolf on: 2014-04-08 16:13:26
Thanks for telling me about this game Pizza!

I will post my WolfKiller when I'm done!
11  Discussions / General Discussions / Re: Creating dev team Java 2d!! on: 2014-04-04 20:47:00
and show me some projects you have done

Well, what about your project(s?) Roll Eyes
OK, Im already fired for my 'since' of humor I guess Tongue
12  Discussions / Miscellaneous Topics / Re: new computer purchase advice on: 2014-04-04 20:04:18
If you just pick an AMD A8-xxxx APU you have for <100 bucks a nice processor + vidcard, will surely be enough for the not 'die-hard-gamer', for you way more than needed, if I see how long u have lived with such an old pc or maybe I have to call it 'wooden pc' or 'oversized gameboy'. (Salt please!)

Motherboard, Case, 8GB memory and a small PSU (300W is more than enough for a setup like this).
Oh yeah, I recommend a Samsung 840 EVO 120GB as well, but they are like 70 bucks so if you don't have the money you can always buy one later since you still need another hard drive for some storage whether you buy that SSD or not. Price: +-400 bucks total.
13  Game Development / Newbie & Debugging Questions / Re: [LibGDX] Ball bouncing problem on: 2014-04-04 19:16:00
I wanted to make like pinball style game ,but  i wanted when ball hits that rectangle stuff sides, then ball changes direction. Or when ball hits that stuff then ball doesn't change direction it just goes up.Can someone help me how to do it.

Thanks! You just threw all of your code to us, and even without a single comment!  Kiss

Not that I think that I want a comment since you cant even explain properly what the problem is.
I mean, what are you talking about: 'rectangle stuff sides' and 'that stuff'?

Serious, if you don't even take the time to explain your problem properly or give us any explanation about your code, you expect us to translate all of your 'stuff' and to take the time to explain the answer?

Please be a little more accurate next time than I can maybe help u.
No offense meant by this post.
14  Game Development / Game Play & Game Design / Re: Dithering Effect [LibGDX] on: 2013-11-20 16:46:40
This is most likely an artifact of your monitor, hence you can't screenshot it. Some older/cheaper TN monitors look like that when high contrast colors move at 1 pixel / frame when V-synced. It bothered me a lot when I had my old monitor.

Know about that, it can also be the (VGA-)cable, a few months ago I bought a new monitor to replace my second monitor, and it also blurred/dithered (with the old VGA-cable), so I tried the new VGA-cable (which was a little bit too short, anyways) and that solved the problem.
15  Game Development / Networking & Multiplayer / Re: [KryoNet] Networking only works on LAN? on: 2013-10-23 23:10:05
No problem Smiley Have you tried running it on local host just to see if it works?

Main post:

Quote
Now when I test the game on the same computer, everything works fine.

I'm not sure if both UDP and TCP work over hamachi (no experience), so hopefully port-forwarding works.
Once, I had this problem in C++ using UDP, but that's another (unsolved) story...
16  Discussions / General Discussions / Re: Java-Gaming at Minecon on: 2013-10-16 20:16:52
Don't tell kids too much about libraries, there is nothing wrong with Java2D (for beginners).
I programmed my first year only in Java2D without any libraries, and it was a nice year.
Java is a really good developed language, you can create very cool games with just plain Java.
As it is more 'low' than OpenGL, they have to think more, creating particle systems theirselves, etc.
Performance is no problem for beginners either, maybe for you, someone who is working on a Skyrim game, but not for beginners, creating simple games.
In other words, don't talk about gaming libraries, that's for later.
That's my opinion, anyways.

And tell them about this forum Wink
Its always nice to have something where you can communicate with people that do the same, learn and to get inspired.

PS:
Tell them about the livestream page from Notch, he programs a lot of awesome Java(2D! Just Plain Java) games there, that's what they all want, NOTCH!
I really like his livestreams and I have watched them a lot (his games are cool).
17  Game Development / Game Mechanics / Re: how to handle sound in a multiplayer game. on: 2013-10-12 19:51:10
I should just handle sound as you handle graphics, so for example:
Server Sends Message: You Die.
Client: Screen Goes Black.
Client: Play Sound
18  Discussions / Miscellaneous Topics / Re: What would you like to see in Java? on: 2013-10-05 19:02:09
I don't want that for-loops (its just me), uninitialized variables oO, I like it as it is, and if you want to walk through a List, you can already do this:
1  
2  
3  
for(Object o : List){
    o.doSomething();
}


Now I see al of that -> stuff, I actually miss pointers in Java, I like them a lot in C, in Java you have to make a lot static, but I understand that Java-developers actually want to dodge this, as this has something to do with memory management.
19  Discussions / General Discussions / Re: Off-Topic: Java and Framework Alternatives - 'Friendly' Discussion. on: 2013-10-05 17:12:45
C/C++, I used the CodeBlocks IDE at first, but I hated that IDE, so I was going back to Eclipse (they have a C/C++ IDE also), so once that problem was solved I started to code a platformer with SDL/OpenGL, I can't say that I don't like it, but the compiler flags, and importing libraries really pissed me off in the beginning (didn't understand it). After that it was quite fun, its a little bit less flexible, because memory management is something you don't have to worry about in Java, but C++ is another language... (Take 2D arrays, and giving them as a parameter to a function for example).

Further Java/C++ are really similar, made a network application, it is really the same as Java-networking. But I ended up with a silly UDP-problem which was no problem local, but over internet (really only over internet, not local) it was behaving really weird (client received first msg from server, nothing more, had nothing to do with firewall/ports, it is really the code/C++).

So I headed back to THE platform-independent, which I really appreciate now, as I had to do it all in C++ myself (my networking was working on Linux/Windows).
20  Games Center / WIP games, tools & toy projects / Re: Paint.JAVA - Attempt at cloning Paint.NET (with cross-platform support) on: 2013-09-30 22:02:11
Mixing Swing and LWJGL is really, really bad idea - believe me, I am developing an application which is mixing them. Wink

Whats the problem?
21  Games Center / WIP games, tools & toy projects / Re: Match Blocks 3 on: 2013-09-26 18:44:05
Yeah, I finished this game and have it uploaded to the play store!

Play Store:
Match Blocks 3

Have Fun All!
22  Discussions / General Discussions / Re: My blog post about Java. on: 2013-09-22 12:09:49
Quote
This is weird but true – but in my test (which is really weird, I’m not sure if I’ve done something wrong.) iterating over 10000000000 elements in Java took 14 seconds while C++ did it in 37.

This is not really weird, maybe this topic can help you further: http://www.java-gaming.org/index.php?topic=30448.0
23  Games Center / WIP games, tools & toy projects / Re: The Chasm on: 2013-09-21 20:02:15
This kind of flat:
http://www.twitch.tv/notch/b/311448724
24  Discussions / Miscellaneous Topics / Re: Hackintosh Dual Boot Tutorial on: 2013-09-21 17:40:19
Thanks for wanting to help people, but (sorry) the video quality is far from good...
Maybe try to capture as much as possible with software (bandicam for example) next time and switch between camera and software in your video. Well, that's what I would do. (And clean my monitor, LoL)

Nice english (and accent xD ) btw, my speaking is really BAD,(not even understandable).
25  Games Center / WIP games, tools & toy projects / Re: Match Blocks 3 on: 2013-09-21 15:26:29
Last feature for now is implemented:





Yeah, Rewards/Goals!

It's ready for Play Store now!
But first things first, I want to build a trailer for that.
(And tons of images for the play store)
26  Games Center / WIP games, tools & toy projects / Re: Oh My Goat on: 2013-09-18 22:09:49
Awesome art, but it doesn't come to android?

Quote
We're on the final process of finishing the game and currently trying to make the game happen on iOS using RoboVM.

Also, in the first 'choose level screen' I don't see a camera at the right top, but in the next one I see one, what is that for?
27  Games Center / WIP games, tools & toy projects / Re: Match Blocks 3 on: 2013-09-16 20:23:28
Huge update, too much to mention, video (and the updated screenshots in main post) say enough I hope:

<a href="http://www.youtube.com/v/92WdPN2xq8U?version=3&amp;hl=en_US&amp;start=" target="_blank">http://www.youtube.com/v/92WdPN2xq8U?version=3&amp;hl=en_US&amp;start=</a>

And don't forget, play it for free, desktop download is in main post, have fun!

Is also coming to Play Store soon Tongue
28  Games Center / Featured Games / Re: The Intergalactic Trashman - [NEW VIDEO - 08/29/2013] on: 2013-09-10 19:58:13
A, B, C or D, I like them all Cheesy Man, you have some very good designers in your team, I am amazed each time I look in your thread again...

Im curious, with which framework is this written?
Please tell me its also coming to OUYA, I love to play games like this on my Ouya Tongue
29  Game Development / Networking & Multiplayer / Re: LWJGL, KryoNet on: 2013-09-05 21:23:24
Should I just send the input of the Client to the Server and let the Server handle the movement of every Client on his own and send it back to All Clients?

This is exact how you should do this, handle everything with your server, and send info playerpositions and stuff to client.

Tasks:
Client: Render, send input to server (there are a few exceptions like chat)
So don't handle the input in the client, like you are doing now:

I'm working this way: The Client sends his position+current moving direction to the server which sends it to all Clients except the one that sent it to him. So the moving of each Client is controlled by the Client and can't be manipulated by the server.

Server: Do the tick, and send (60 times per second?) stuff like playerpositions back. And never forget: DON'T TRUST THE USER! Tongue

Good luck with your game!
30  Discussions / General Discussions / Re: How long were you programming with Java before you made your first game? on: 2013-09-05 19:56:26
After 2 Months reading a book I did some tutorials on YouTube, I made a tower defence with help of ulixava, and after that my very first game, (after 3 months in total?)

It was a game where you was an airplane and had to shoot tanks on the ground, tanks shot targeted bullets back if they saw you (your airplane). It is the project I learned the most from, like NOT using ints for rotations/positions..

Learned OpenGL after a year when I played around with C++... First had no need to use it as Java is very good/far developed itself.
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.

xsi3rr4x (64 views)
2014-04-15 18:08:23

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

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

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

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

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

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

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

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

CJLetsGame (216 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!