Jump to content

  • Log In with Google      Sign In   
  • Create Account

Awesome job so far everyone! Please give us your feedback on how our article efforts are going. We still need more finished articles for our May contest theme: Remake the Classics

Getov

Member Since 01 Sep 2012
Offline Last Active Today, 02:04 PM
-----

Posts I've Made

In Topic: Tower Defense Game 3D

08 March 2013 - 06:38 AM

I forgot to mention that I get "OpenGL error: 1282 invalid operation" but it doesn't help me at all. 


In Topic: C++ Books

17 February 2013 - 05:28 AM

One more vote for Programming: Principles and Practice Using C++

After you finish it (and by finishing I mean learn it and do all the drills and exercises), I highly recommend The C++ Standard Library by Nicolai Josuttis


In Topic: Magnifier Tool

19 December 2012 - 05:15 AM

My OS is Windows 7 64 bit, setOpacity doesn't seem to work fine for me. I'll be glad if you have any other ideas and if someone know specific library for doing that job. I did find JxCaputre library but I don't know if it will be of any use.

In Topic: Java Scroller Game

11 December 2012 - 06:03 PM

Actually I may not use threads in this simple game, I managed to smooth my movement. Now I will try to optimize my code as much as possible.
The only problem I have is that when I press 2 keys at the same time (fire & movement) it registers only one key. ( there is no anti-ghosting :D ).
Any tips on that how to achieve it ? Thanks in advance !

that's my code to register the keyboard input:

[source lang="java"] public void keyPressed(KeyEvent e){ switch (e.getKeyCode()){ case KeyEvent.VK_LEFT: keyLeft = true; break; case KeyEvent.VK_RIGHT: keyRight = true; break; case KeyEvent.VK_SPACE: space = true; break; } } public void keyReleased(KeyEvent e){ switch (e.getKeyCode()){ case KeyEvent.VK_LEFT: keyLeft = false; break; case KeyEvent.VK_RIGHT: keyRight = false; break; case KeyEvent.VK_SPACE: space = false; break; } }}[/source]

This is in my main class:

[source lang="java"] private class MyActionListener extends KeyAdapter { public void keyPressed(KeyEvent e){ player.keyPressed(e); } public void keyReleased(KeyEvent e){ player.keyReleased(e); } }...................................................................................... public void actionPerformed(ActionEvent e){ /* TODO: anti-ghosting */ if (player.keyLeft){ player.moveLeft(); } else if (player.keyRight){ player.moveRight(); } else if (player.space){ player.generateBlaster(); } ............................................}[/source]

In Topic: Java Scroller Game

11 December 2012 - 01:00 PM

OMG , jesus , I can't believe...... so stupid error.... THANKS man, I didn't even notice it.
Shit happens :D .

Thanks again, in the next few days I might have questions about making the game smoother , using threads and pressing more than 1 key at once... but for now I will try to do it myself :).

PARTNERS