Show Posts
|
|
Pages: [1] 2 3 ... 58
|
|
6
|
Game Development / Newbie & Debugging Questions / Re: [Java2D] findind x and Y after Rotation
|
on: 2013-04-26 14:36:46
|
I'm also not sure about your question, but I'm gonna make an assumption that you are looking for the tip of the gun's x and y? If that is the case, then you just use your basic trigonometry knowledge: Sin means the y value of an angle on a unit circle (r=1). Cos means the x value. In order to find the tip of the gun you would do this: 1 2
| gunTipX = math.sin(gun.angle)*gun.length + gun.x; gunTipY = math.cos(gun.angle)*gun.length + gun.y; |
Hope I could be of help  . If I misunderstood your question, then please clarify  .
|
|
|
|
|
7
|
Game Development / Newbie & Debugging Questions / Re: Collision Detection for tiled map via cross products?
|
on: 2013-01-16 09:34:12
|
|
well, with your current setup it might be a little tricky. This is something I've seen very commonly with people using Slick.
Instead of checking each time which keys are down for movement, you could respond to the events keyPressed and keyReleased, and then set a velocity for your sprite (rectangular form), and then if you run into a wall going up, you just set your y component to zero which won't affect your x component at all.
Does that make sense?
|
|
|
|
|
10
|
Game Development / Newbie & Debugging Questions / Re: ConcurrantModificationException
|
on: 2012-12-31 15:14:27
|
I personally just use the simple for-loop  I think it is a lot easier to just use that line of code (which shouldn't confuse you at all), and not have to worry about multiple lists and the like. On another note, I don't agree with your use of a removal list, I would just use the boolean like ra4king recommended. And also, look into having a single list if you can, it is much cleaner and often easier to handle as your game becomes more complicated (less loops).
|
|
|
|
|
13
|
Discussions / General Discussions / Re: Trying To Make A Shared JTextArea
|
on: 2012-12-30 20:50:40
|
|
You could synchronize your two users using a database. Not sure how scalable that would be. Another alternative would be to have a server program that communicates with the clients and has a central copy of the edited document and uses it to keep the clients synchronized.
Hope I could help, h3ckboy
|
|
|
|
|
21
|
Game Development / Newbie & Debugging Questions / Re: GTGE, unknown amount of buttons
|
on: 2012-12-17 21:59:15
|
You could just include the counter, i, in the name. so 1
| TButton button = new TButton("" + item, 8, 415 + (25 * i), 90, 25) { |
becomes 1
| TButton button = new TButton("" + item + " #"+i, 8, 415 + (25 * i), 90, 25) { |
does that solve your problem?
|
|
|
|
|
22
|
Game Development / Newbie & Debugging Questions / Re: WHY DOES THIS WORK o.0
|
on: 2012-12-17 20:48:21
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| public void render(){ BufferStrategy bs = getBufferStrategy(); if(bs==null){ createBufferStrategy(3); return; } Graphics g = bs.getDrawGraphics(); for(int i=0;i<pixels.length;i++){ pixels[i] = new Random().nextInt(0x0000FF) << 16; } g.drawImage(img, 0, 0, getWidth(), getHeight(), null); g.dispose(); bs.show(); } |
Is this not what your looking for? I'm sorry if I misunderstand the question.
|
|
|
|
|
23
|
Discussions / General Discussions / Re: Current game engines
|
on: 2012-12-17 16:22:17
|
|
I've used GTGE and it was fine, despite the fact that it hasn't been updated in a while.
I've also used Slick and it was awesome.
It really is your choice, try making something simple with both and see which you like better.
|
|
|
|
|
26
|
Game Development / Networking & Multiplayer / Re: Wordpress Login
|
on: 2012-11-12 15:05:17
|
I don't know how to use WordPress, but as for the nifty gui, a very short google search gave me the answer you were looking for. 1 2 3 4 5 6
| public void submit1() { TextField textField = screen.findNiftyControl("username", TextField.class); String username = textField.getText(); textField = screen.findNiftyControl("password", TextField.class); String password = textField.getText(); } |
Hope this is what you were looking for  .
|
|
|
|
|
27
|
Game Development / Newbie & Debugging Questions / Re: I can't build my project
|
on: 2012-11-12 14:44:22
|
Check your capitalization in your file names. The IDE lets you get away with it, but in a jar it will crash. I've had that problem in the past  . However, if that isn't the problem, can you give us the actual exception? As far as I can tell you have only shown us the code that throws the exception.
|
|
|
|
|
|
Add your game by posting it in the WIP section,
or publish it in Showcase.
The first screenshot will be displayed as a thumbnail.
|
|