Jump to content

Movement Tracker


MikeFez
 Share

Recommended Posts

well, don't put too much on your plate at once, thats a common mistake, too many people get discouraged from finishing projects because they step back and look at the whole huge picture and think:

"How the hell am I gonna do all this?"

but if you take it in small chunks, just focus on the task at hand, and handle problems as they arise, then it's done before you know it, and it keeps you mind off the "what will doing this do to the program as a whole" mentality

and as soon as you get stuck, or finish a basic beta version, post it here and people can(and will) help you to make it better.

and eventually, you end up with a fun/usefull game/tool that is great and shows autoit's true potential

Thats quite the talk there, it did help me out thanks :D . Right now I'm going to just start off with the ball moving along the X axis and with that I'll set up the detection... Now that its kinda in steps, it seems like less of a challenge (Even though its going to be a hell of one)

Link to comment
Share on other sites

  • Replies 67
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

I added a detection to see if the ball passes the paddle, but i'm wondering what would be the best way to track the ball and have it detect the paddle? The only way I can think of right now (its 5:13) is to have the mouse follow the ball everywhere and it can pixlecheck constantly for the paddle... but that would render the mouse unusable to quit or select options... what ways can you think of? BTW the script in the first post isnt updated yet so dont c&p it.

I made a mini stand for my camera, all I need is a whiteboard and I can make erasable pong playing fields (when I finish)

Edited by MikeFez
Link to comment
Share on other sites

This is interesting, hope pong works out for you.

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

@rakudave, my desktop is 1152x864 so i decided to use 1024x768 and it worked.

My Programs:AInstall - Create a standalone installer for your programUnit Converter - Converts Length, Area, Volume, Weight, Temperature and Pressure to different unitsBinary Clock - Hours, minutes and seconds have 10 columns each to display timeAutoIt Editor - Code Editor with Syntax Highlighting.Laserix Editor & Player - Create, Edit and Play Laserix LevelsLyric Syncer - Create and use Synchronised Lyrics.Connect 4 - 2 Player Connect 4 Game (Local or Online!, Formatted Chat!!)MD5, SHA-1, SHA-256, Tiger and Whirlpool Hash Finder - Dictionary and Brute Force FindCool Text Client - Create Rendered ImageMy UDF's:GUI Enhance - Enhance your GUIs visually.IDEA File Encryption - Encrypt and decrypt files easily! File Rename - Rename files easilyRC4 Text Encryption - Encrypt text using the RC4 AlgorithmPrime Number - Check if a number is primeString Remove - remove lots of strings at onceProgress Bar - made easySound UDF - Play, Pause, Resume, Seek and Stop.
Link to comment
Share on other sites

Dont worry about the resolution... I realised it was unessasary and I removed it for the next release... just pick any of them, they all do the same thing. I'll have an update soon, but I'm having a problem with the ball appearing.. so yea I'll get back to you guys

Link to comment
Share on other sites

Hey, I just came up with a great example of what you could implement in the pong game you are working on. I wrote a light beam example. Just drag around the points to put the line in the path of the light beam and the light will reflect off the line (mirror). Here is the code:

light.au3

Now, imagine one of the paddles is the blue line and the red line is the path of the ball! :D Hope you like it!

Link to comment
Share on other sites

Hey, I just came up with a great example of what you could implement in the pong game you are working on. I wrote a light beam example. Just drag around the points to put the line in the path of the light beam and the light will reflect off the line (mirror). Here is the code:

light.au3

Now, imagine one of the paddles is the blue line and the red line is the path of the ball! :D Hope you like it!

Awsome, I'm sure the whole light beam bouncing off mirror thing would work, thanks! This should speed up the thing
Link to comment
Share on other sites

Hey, I just came up with a great example of what you could implement in the pong game you are working on. I wrote a light beam example. Just drag around the points to put the line in the path of the light beam and the light will reflect off the line (mirror). Here is the code:

Now, imagine one of the paddles is the blue line and the red line is the path of the ball! :D Hope you like it!

The codes looks great, :wacko:

want to test it, but goddamn virus deleting some dll i need to boot in windows has forced to temprarily boot to a crappy linux distro from live CD

Link to comment
Share on other sites

The codes looks great, :D

want to test it, but goddamn virus deleting some dll i need to boot in windows has forced to temprarily boot to a crappy linux distro from live CD

Unbuntu or whatever its called? Anyways, I'm planning for a release tommorow if I can get a few glitches out of the way, and going to fix up some stupid things I did (like setting it up so that the ball has to hit the correct pixle in order for it to detect a collision, the new way will just scan all 10 pixles in front of the ball for the defined choice...

Link to comment
Share on other sites

Unbuntu or whatever its called? Anyways, I'm planning for a release tommorow if I can get a few glitches out of the way, and going to fix up some stupid things I did (like setting it up so that the ball has to hit the correct pixle in order for it to detect a collision, the new way will just scan all 10 pixles in front of the ball for the defined choice...

but wouldn't "in front" be relative to traveling direction?

like it its going left to right, then "in front" = right side of the ball

but from right to left "in front" = left of ball

I recomend "ControlGetPos()" and then comparing the 2 so if the ball is part of the paddle then "_Reflect()"

Edited by Paulie
Link to comment
Share on other sites

but wouldn't "in front" be relative to traveling direction?

like it its going left to right, then "in front" = right side of the ball

but from right to left "in front" = left of ball

I recomend "ControlGetPos()" and then comparing the 2 so if the ball is part of the paddle then "_Reflect()"

Ahh damn, your right... Acually though, I can just scan both sides of the ball correct? or even, go one pixel more than the ball x and y... that will work wont it? and about "_Reflect()", i've seen the _Word() things before, what is their purpose? This is my first, I really dont know much but the basics of autoit... I promise I wont let you guys down though
Link to comment
Share on other sites

Ahh damn, your right... Acually though, I can just scan both sides of the ball correct? or even, go one pixel more than the ball x and y... that will work wont it? and about "_Reflect()", i've seen the _Word() things before, what is their purpose? This is my first, I really dont know much but the basics of autoit... I promise I wont let you guys down though

"_word()"

is like calling a function...

and the underscore or "_"

signify's its a UDF or user defined function.

I took "Reflect()" from Erifash's script, but i just mean to use his "physics"

Link to comment
Share on other sites

"_word()"

is like calling a function...

and the underscore or "_"

signify's its a UDF or user defined function.

I took "Reflect()" from Erifash's script, but i just mean to use his "physics"

ooooh, that will help out a ton now lol... before I made a hidden button so I could continue (Like when you select your display, there is a hidden button that is called on when you pick what size)

Link to comment
Share on other sites

ooooh, that will help out a ton now lol... before I made a hidden button so I could continue (Like when you select your display, there is a hidden button that is called on when you pick what size)

Glad i could help
Link to comment
Share on other sites

Damn... I'm having issues with the paddles, because there isnt an exact place that they go...

"I recomend "ControlGetPos()" and then comparing the 2 so if the ball is part of the paddle then "_Reflect()"" It wont work because the paddle is just a pixel... should I overlay an image of a paddle, so instead of a finger being the paddle, the paddle is over the finger? Then since the paddle is one color, detection would be easier

EDIT: also, if this was done, the paddles will be the same size for both players, so it would be more fair

Edited by MikeFez
Link to comment
Share on other sites

I don't think you're quite getting my example. Whatever object you use for the paddles, have the movement tracker find both ends of the object. After that you just have to modify my light script to use those two ends as the "mirror". Although you might need to modify the trig calculations because the ball won't always be coming in on a completely flat line (therefore not a 90 degree triangle). Once you do that then you have the rise and run of the "reflected" ball at a length of 500 pixels. If that's too big then set up a ratio where

rise / run = speed / x
and speed is how many pixels the ball moves per loop in the code. Then just solve for x and you have your new rise and run that you can move the ball by. The ball will also need to be reflected off the walls the same way.

Ummmm... This is going to be really complicated. :D I'll try to write a new example where you can modify the angle of the light beam.

Link to comment
Share on other sites

Ummmm... This is going to be really complicated. :D I'll try to write a new example where you can modify the angle of the light beam.

Thanks, I was trying that and got stuck (.hack rules by the way)

Sorry guys, I know you expected an update today, I went to sleep at 3 in the morning expecting to work all day today, but I just woke up at 6 in the afternoon like wtf? Now I need to pack for a wedding, and I wont be back untill friday

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...