473,405 Members | 2,344 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,405 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 1445
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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...
0
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,...
0
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...

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.