Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Easy question, but I'm not smart enough

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
0
0
Hi,

I want to move a picture by pushing a button down (KeyDown), and I will that on holding the button pushed the
picture is going more and more faster, to a limit. Also becoming slowlier on leaving the button. I know that i've to do this with timers, but i'dont know how.
You've to think of this like a little carrace.
Please help me.
Thank you greg
would be kind of you i've you send your answer on gregorhesse@t-online.de

P.S.: Excuse my English
 
you could set a static thingy... and have every time they click thebutton check to see if the variable is to the max number yet .. if not then add 10 to it which is to the speed of the moving picture... ditto with going down if you need the code let me know
in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?
 
I also would use a variable, but instead of using addition and subtraction, you can multiply and divide in order to accelerate and decelerate the movement:

lngMove = 1

move lngmove,....

lngMove = lngMove * 10

Then loop. The first move will be 1, then 10, then 100, then 1000, etc. Just adjust the multiplier if it accelerates too fast.
 
yeah thats why i would use subtraction and addition.. so you have a sturdy increase/decrease of speed. nothing goigj up to fast.. it also depends on how many times he wants the button to be pushed.. if he wants the user to beable to push it a few good times then addition subtraction would be good.. if he would like it a couple of pushes id suggest multipiers and such.. -shrug i dunno mayeb its just me. hehehe


or.. another though... you could have it check and see what the value is.. and mayeb have 3 - 4 pre set speeds.. and check see what it is and if it is x then x = y you know? it all really depends on how you want it to work... i just figures scrolling pictures.. perhps you would want a wide area of speed increase..


while on this topic.. anyone know how to stop controls from flickring while they move? that is SOOOOOO annoying.. or can you only stop that with direct x? :( in the begining man created code.
in the end code will create man.
clones are coming only matter of time.
examples?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top