473,396 Members | 1,770 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,396 software developers and data experts.

when scrolling a form vertically the "y" coords of a picturebox are reset!

Hi,

I am writing a small game that is using a form 800 * 600. The form
can be scrolled vertically up to a height of 1200 (basically the form
can be scrolled down one screen vertically).

The user controls a picturebox (my sprite) with the cursor keys

When the sprite hits the y value of 600 the screen scrolls down to
display the bottom part of the screen (by focusing on a hidden
picturebox at (0,1200).

This works fine and the sprite is displayed at the top the scrolled
down form.

However the "y" coordinate of the picturebox is now 1 instead of 601.
It appears as soon as the form is scrolled the x,y cordinates become
relative rather than absolute. So that even though we are at position
y=601 because we are at the top of the (scrolled down) form it think
we are at position 1.

Of course this is causing havoc with my collision routine as the
sprite keeps bumping into objects from the top part of the form even
though it is on the bottom part of the form!!!

Does anyone have a solution for this?

p.s. I've tried adding 600 to the "y" value when we first scroll the
form, but this just then moves the sprite to the bottom of the
scrolled down form. I also noticed if you don't scroll the form but
continue to move the sprite down the way then the "y" value keeps it's
absolute value.

Regards,

Scott M.
Nov 22 '05 #1
0 841

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

Similar topics

2
by: John Davis | last post by:
I want to know what's the differences between Request.Form("Field Name") and Request.QueryString("Field Name") OR they function exactly the same, which is to return the value of the field?? ...
18
by: Mr.Clean | last post by:
I have a table and would like to make it scroll if more rows are in the table than are visible in the height. How would I do that? overflow: scroll; doesn't work in IE or mozilla on this table.
1
by: Kenneth Keeley | last post by:
Hi If I have a page that has some text boxes and some dropdown list and some buttons How do I go about place a reset button on the page. This button should clear all the text boxes and reset the...
9
by: Dan | last post by:
I am trying to use Request.Form("__EVENTTARGET") to get the name of the control that caused a post back. It keeps returning "". I am not really sure why, this happens for all of my controls...
2
by: Jerry Spence1 | last post by:
I haven't got a "Windows Forms" tab in my toolbox. I think I accidentally right clicked and deleted it. How do I get it back? -Jerry
7
by: Kermit Piper | last post by:
Hello, How can you clear session variables when a reset button is pressed? I thought I might be able to do something like: <% If request.form("Reset") = "Reset" then Session("variable") =...
2
by: Roger Withnell | last post by:
I need to reset a form to its original value using onclick rather than the Reset button. So, I have: <input type="button" name="reset" id="reset" value="Reset" onclick="form1.reset();"> where...
38
by: Sanders Kaufman | last post by:
I'm converting my table-based layouts to css-positioned divs - but the ONLY reason I'm doing it is because it's *considered* a best practice. I don't really see where anything goes hinky when...
1
by: apking | last post by:
Hi friends.. iam trying to reset form fileds with javascript function.but it will not working.iam using this one.. <script language="Javascript"> function reset() {...
3
by: eBob.com | last post by:
How does a "sub-form", i.e. one invoked by another form, determine anything about the form which brought it into existence, i.e., I suppose, instantiated it? I wanted to so something like this ......
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?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.