473,385 Members | 1,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Small problems with game..

Hello all,

Hope you all had a enjoyable Christmas and New Year!

Making some good progress on my Air Hockey game, which you've all
heard so much about! :)

Apologies for the vagueness of the following:

Having some little problems not... got my hit-testing working but am
having problems with it at the bottom of the table (typically) for
some reason. The puck seems to react a couple of times at the bottom.
Here's a link to my Table form (along with the Table and puck - put in
Debug folder to work!)

Could ye please have a look at it and suggest why this could be
happening?

PS - Also, i'm about to begin to implement user interaction into it.
Such as the puck reacting when the mouse enters it? How could i go
about implementing this?
Nov 16 '05 #1
3 1444
Brian,

You haven't posted any code, or attached a project. It would be helpful
=)
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Brian" <br************@gmail.com> wrote in message
news:c2*************************@posting.google.co m...
Hello all,

Hope you all had a enjoyable Christmas and New Year!

Making some good progress on my Air Hockey game, which you've all
heard so much about! :)

Apologies for the vagueness of the following:

Having some little problems not... got my hit-testing working but am
having problems with it at the bottom of the table (typically) for
some reason. The puck seems to react a couple of times at the bottom.
Here's a link to my Table form (along with the Table and puck - put in
Debug folder to work!)

Could ye please have a look at it and suggest why this could be
happening?

PS - Also, i'm about to begin to implement user interaction into it.
Such as the puck reacting when the mouse enters it? How could i go
about implementing this?

Nov 16 '05 #2
I think that what is happening is that your puck sometimes winds up
below the bottom of the table, so far that it is two velocity-intervals
off, so that it senses it is off, reverses direction, then in the next
cycle sees it is _still_ off, reverses direction again, and - somehow;
this isn't really clear to me - finds its way back onto the table this
time. I think the root cause of this may be the discrepancy between
your "pth" region, with a boundary at 596, and your lower bound limit
of 595. Another source of problem is the diagonals of the pth
trapezoid - with respect to x position, it will be common to see it
"straddle" the boundary because the x coordinate of the boundary
changes as it moves in the y direction.

HTH,
--Carl

Nov 16 '05 #3
Hello Brian. The game is coming along nicely since the last time I saw it.

In your game-draw routine, where you check for the ball position, you need
to allow the top-bottom left-right test to adjust the velocity in both
planes X and Y in a single cycle. The ball is getting stuck on the edges and
wobbling in certain circumstances. I think this is because the puck velocity
isn't 1 so the puck can travel past the edge far enough that it gets locked
in a zone where it's always off the edge and bouncing with every go round
the loop.
--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.

"Brian" <br************@gmail.com> wrote in message
news:c2*************************@posting.google.co m...
Hello all,

Hope you all had a enjoyable Christmas and New Year!

Making some good progress on my Air Hockey game, which you've all
heard so much about! :)

Apologies for the vagueness of the following:

Having some little problems not... got my hit-testing working but am
having problems with it at the bottom of the table (typically) for
some reason. The puck seems to react a couple of times at the bottom.
Here's a link to my Table form (along with the Table and puck - put in
Debug folder to work!)

Could ye please have a look at it and suggest why this could be
happening?

PS - Also, i'm about to begin to implement user interaction into it.
Such as the puck reacting when the mouse enters it? How could i go
about implementing this?

Nov 16 '05 #4

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

Similar topics

0
by: Michael Goettsche | last post by:
Hi there, for a project in our computer science lessons at school we decided to write a client/server based battleship like game . I know this game could be written without a server, but the...
0
by: Brian | last post by:
Thanks everyone for the feedback on the game. It's all very useful stuff, and i sincerally thank you all for taking the time to look at the game / source code and replying. I will take a look at...
10
by: connyledin | last post by:
Im trying to create a version of the game Wumpus. Mine is called Belzebub. But im STUCK! And its due tuesday 2 maj. Im panicing! Can some one help me?? here is the file:...
74
by: lovecreatesbeauty | last post by:
My small function works, but I have some questions. And I want to listen to you on How it is implemented? 1. The function does not check if parameter x is larger or smaller than parameter y. ...
0
by: rock826 | last post by:
If you have known the addiction of ZUMA then you will sure love this game. Be care full this game is very addictive. Enjoy!!! http://www.stuff4world.com/fun/pinbola.htm To mask URL and...
0
by: rock826 | last post by:
If you have known the addiction of ZUMA then you will sure love this game. Be care full this game is very addictive. Enjoy!!! http://www.stuff4world.com/fun/pinbola.htm To mask URL and...
2
by: vertozia | last post by:
Hey there, ive been having difficulty placing an image, this is my screenshot, and what ive done so far: http://img341.imageshack.us/img341/9894/gridwg2.jpg /** * ConnectFourGUI * Provide...
23
by: arnuld | last post by:
My friend sent me the prototype of a game written in C++ and asked for advice: IDEA: Game will ask the user to thin of a number. User will press a keystroke after he has thought of a number....
8
by: triphoppa | last post by:
Here is my problem I'm supposed to write a tic-tac-toe game.By the way this is the biggest program I've ever attempted to write. When I started writing the game I thought that it wouldn't be too...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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
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...

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.