473,491 Members | 2,430 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Simultaneous keypresses in Pong game

Hi,
i have created a Pong game Application where two players control their
pads using the keyboard. the problem is that one player is using the
action keys
VK_UP and VK_DOWN in keyPressed() and the other, characters 'w' and
's' in keyTyped(). when both players hit a key simultaneously and keep
it pressed then only one of the two pads move. on the other hand if
both hit their keys fast then everything works ok. i declared both
keyPressed and keyTyped as "synchronized" but it doesn't seem to work.
what can i do in order to process them simultaneously? there is a run
method in my application as well.

thank you
Jul 17 '05 #1
0 1842

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5506
by: Xad | last post by:
Hi, i'm looking for java code for a really simple, basic Pong game. As simple as possible - even just two paddles and a ball bouncing will do. Can anyone help? Thanks
1
2434
by: slugger | last post by:
Hope this is not OT: I am running into some strange things whenever my ASP pages send out simultaneous requests to another ASP page which in turn gains access to a MySQL database using a DSNless...
6
2306
by: Jimnbigd | last post by:
I want to write a game, and sounds will really add to it. Note that I would always make the sounds optional. I hate it when I go to a URL and unexpectedly get sounds or music. I have played...
0
1520
by: Will | last post by:
I am looking to include a pong game or similar in an application I have developed. I know it's possible to write a pong style game in VB is it possible to write a pong style game in VBA? & can...
4
5859
by: Dr_Locke_Z2A | last post by:
I was talking to my uncle the other day about getting into programming games and he recommended to start teaching myself with really simple games, like Pong simple. So I looked on google and...
7
3178
by: DaVinci | last post by:
I am writing a pong game.but met some problem. the ball function to control the scrolling ball, void ball(int starty,int startx) { int di ,i; int dj,j; di = 1; dj = 1; i = starty;
26
3654
by: I Hate My Computer | last post by:
I need help with some VB code. Ultimately I would like it in VBA because that's all I have. I am making a fun game to hide in all of my docs. It is a pong like game but you need to have your pad...
6
2587
by: drsmooth | last post by:
im just starting to work on AI things and i started with a pong game... i came up with a system that every time the ball hits a wall or a paddle it calls the alert() method of the AIController...
4
6443
by: raylopez99 | last post by:
Compound question: first, and this is not easy, if there's a way to detect multiple simultaneous key presses in C# let me know (in the below code, keys c and d being pressed simultaneously or...
0
7154
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7190
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6858
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5451
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3076
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
633
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.