Jump to content
Sign in to follow this  
bass711

Ok easy question

Recommended Posts

bass711

Ok i seach for hotkeys and pixel search but all i found is movemouse mouseclick etc etc

my question is how do i make a paddle that moves up and down only to follow a bouncing ball

I can easy make it when is controlled by mouse by using mousemove but now that case is difrent

I need to use {up} and {down} keys, i need something like pixelsearch if is found use cordinate up and down

thank you for reading my terrible english, srry

Edited by bass711

Share this post


Link to post
Share on other sites
bobchernow

I don't think you have given enough information. How far do you want the keys to move the paddles. You could use hotkeys to fire a function. Everytime the function fired it would move the paddle up or down the screen so many pixels. The difference being that with a mouse move you can see where it was moved to. With the keyboard you have to decide how far to move the paddle with each press.

Bob


--------------------bobchernow, Bob ChernowWhat a long strange trip it's beenUDFs: [post="635594"]Multiple Monitor Screen Resolution Change[/post]

Share this post


Link to post
Share on other sites
bass711

Well my game is 800x600 i made it with gamemaker lol is just for testing I figure it out how to do it with mouse now i need to know how to do it with keys, you say i need cordinates on how far to move in this case is only verrtical for 800 high but still the ball bounce to 800x600 area i Need to know when the ball decreases hit down key when increase hit up

so if pixelsearch on the area 0x0x239B1F the cordinates lower the value hit down key to paddle if the cordinates goes up hit up key but how i write the code

my is terrible

$color = 0x239B1F

 


    $coord = PixelSearch( 10, 10, 800, 600, $color)
         If IsArray($coord) = 1 Then  
      Send("{up}")   here i need help to make cordinate from both keys up and down
    Else
        Send("{down}")

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×