MikeFez Posted July 16, 2006 Author Posted July 16, 2006 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" mentalityand 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 potentialThats quite the talk there, it did help me out thanks . 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)
MikeFez Posted July 16, 2006 Author Posted July 16, 2006 (edited) 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 July 16, 2006 by MikeFez
RazerM Posted July 16, 2006 Posted July 16, 2006 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.
rakudave Posted July 16, 2006 Posted July 16, 2006 hmm, there's a small problem with the scren-resolution... i use a widescreen, which is not selectable in your gui could you fix that? thx you might use @DesktopHeight and @DesktopWidth to do the selection Pangaea Ruler new, UDF: _GUICtrlCreateContainer(), Pangaea Desktops, Pangaea Notepad, SuDoku, UDF: Table
RazerM Posted July 16, 2006 Posted July 16, 2006 @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.
MikeFez Posted July 16, 2006 Author Posted July 16, 2006 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
erifash Posted July 17, 2006 Posted July 17, 2006 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! Hope you like it! My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver
MikeFez Posted July 17, 2006 Author Posted July 17, 2006 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! 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
Paulie Posted July 18, 2006 Posted July 18, 2006 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! Hope you like it!The codes looks great, 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
MikeFez Posted July 18, 2006 Author Posted July 18, 2006 The codes looks great, 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 CDUnbuntu 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...
Paulie Posted July 18, 2006 Posted July 18, 2006 (edited) 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 ballbut from right to left "in front" = left of ballI recomend "ControlGetPos()" and then comparing the 2 so if the ball is part of the paddle then "_Reflect()" Edited July 18, 2006 by Paulie
erifash Posted July 18, 2006 Posted July 18, 2006 This looks like it's going to be great! Too bad I don't have a webcam... My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver
MikeFez Posted July 18, 2006 Author Posted July 18, 2006 but wouldn't "in front" be relative to traveling direction?like it its going left to right, then "in front" = right side of the ballbut from right to left "in front" = left of ballI 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
Paulie Posted July 18, 2006 Posted July 18, 2006 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"
MikeFez Posted July 18, 2006 Author Posted July 18, 2006 "_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)
Paulie Posted July 18, 2006 Posted July 18, 2006 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
MikeFez Posted July 18, 2006 Author Posted July 18, 2006 (edited) 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 July 18, 2006 by MikeFez
erifash Posted July 18, 2006 Posted July 18, 2006 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 whererise / run = speed / xand 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. I'll try to write a new example where you can modify the angle of the light beam. My UDFs:_FilePrint() | _ProcessGetName() | _Degree() and _Radian()My Scripts:Drive Lock - Computer Lock Using a Flash DriveAU3Chat - Simple Multiuser TCP ChatroomStringChunk - Split a String Into Equal PartsAutoProxy - Custom Webserver
MikeFez Posted July 18, 2006 Author Posted July 18, 2006 Ummmm... This is going to be really complicated. 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
rakudave Posted July 18, 2006 Posted July 18, 2006 there's no need to hurry... Pangaea Ruler new, UDF: _GUICtrlCreateContainer(), Pangaea Desktops, Pangaea Notepad, SuDoku, UDF: Table
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now