473,401 Members | 2,125 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,401 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.
Jul 21 '05 #1
0 897

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
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
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
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...
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.