rush4hire Posted March 10, 2007 Share Posted March 10, 2007 (edited) I wanted to wait till it's finished, to post about it, but I just can't wait.It's so cute.So.... I'm gonna start working on the ghosts now.. This is wearing me out cause.1. Autoit is really not for making arcade games, but I want the challenge.2. I don't have a source code for pac-man. I'm just thinking it out from scratch.Here's a zip with the script and sound files and a compiled.http://www.rush4hire.com/files/autoit_pacman.zipHere's the home page: http://www.rush4hire.com/autoit_pacman/Here are some screenshots:The official icon: Game what I have so far: --- DAY 3 --- It's comming along real well.I have death, change of level (very dramatic), all the fruits, and I fixed the pac-man moving through walls bug.Now I just need to focus on the ghost behavior, timing of fruits, high score system, and w/e else.Here's the latest package with the same sound files:http://www.rush4hire.com/autoit_pacman/aut...c-demo-1.02.zipHere's the latest script by itself: packman.au3It's rigged in this one for testing purposes.It will be just like the origional 1979 game in gameplay.. But certain things will be better. Like the apple.. It will be green (there's too much red with the strawberry and cherrys)Oh, ya and there will be a banana instead of grapes or w/e. I couldn't find grapes.. --- DAY 5 ---The ghosts do everything they are supposed to do, but it's hard to test alot because the graphics cause so much lag. So I have to try this ProSpeed thing or something.More comments in my next post.I added some sound files so here's a new zip.I got some background music, but the graphics cause lag. If you comment out these calls at the bottom like this:While 1 sleep($CURRENTSPEED) If $ISPAUSED Then ContinueLoop If Not $GB Then $GB = 1 $GBOTTOM = Not $GBOTTOM Else $GB = 0 EndIf ; pacmove() ; checkghosts() ; checkdelays() playloop() WEndAnd the only thing happening is playloop() then the sound timing is fine, but the lag causes the sound loop to pause.Also I should give some instructions:The arrow keys move pacman.Space bar to pause.Esc to exit.You can drag the Window but you have to click in an area where there are no graphics.If you pause it will unset the hotkeys. So when you want to unpause, just click the window again.packman.au3.zipautoit_pacman.zip Edited March 13, 2007 by rush4hire Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player Link to comment Share on other sites More sharing options...
McGod Posted March 10, 2007 Share Posted March 10, 2007 Very very nice! Love the sounds [indent][center][u]Formerly Chip[/u][/center]~UDFs~[/indent][u]IRC.au3 - Allows you to connect to IRC ServersINetCon.au3 - Connects/Disconnects/Check Status of InternetHardware Key - Creates a unique hardware hashScriptComm - Allows you to communicate between scripts using WM_COPYDATA[/u][indent]~Programs~[/indent][indent]SimonAu3ForumsIRC Bot~Web Site~Web Autoit Example[/indent][indent][b][/b][/indent][u][/u] Link to comment Share on other sites More sharing options...
Lakes Posted March 10, 2007 Share Posted March 10, 2007 Have you seen the ProSpeed thread? http://www.autoitscript.com/forum/index.ph...amp;hl=ProSpeed 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
rush4hire Posted March 10, 2007 Author Share Posted March 10, 2007 Have you seen the ProSpeed thread? http://www.autoitscript.com/forum/index.ph...amp;hl=ProSpeedYa, I was looking at ProSpeed today. It's very impressive.But I have already been doing this with graphics functions, and not using image files. It looks like prospeed is mainly for messing with image files.Now I can draw the ghosts' bodies in all the different colors, and make all the different eyes, with the 2 types of bottoms, 2 blue shades when they turn blue, and w/e else... but I'm not sure how organize it all in one or 2 x 3 demensional arrays..I just can't stand redundancy, or I would be all done by now.. Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player Link to comment Share on other sites More sharing options...
Lakes Posted March 10, 2007 Share Posted March 10, 2007 ProSpeed is for Game sprites as well.. 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
Geeky Posted March 10, 2007 Share Posted March 10, 2007 Very nice! Although Pacman started acting weird at some point, it wouldn't "eat" the dots, and it went through walls :S Link to comment Share on other sites More sharing options...
NELyon Posted March 10, 2007 Share Posted March 10, 2007 Worked GREAT for me. I seriously had fun, even without the ghosts. Link to comment Share on other sites More sharing options...
rush4hire Posted March 10, 2007 Author Share Posted March 10, 2007 ProSpeed is for Game sprites as well.. Nice! I really want to try ProSpeed. I have to finish this first, then I might be able to use ProSpeed to optimize it. Very nice! Although Pacman started acting weird at some point, it wouldn't "eat" the dots, and it went through walls :SI know about that bug, but I will have to fix it when the whole thing is complete. Worked GREAT for me. I seriously had fun, even without the ghosts.Hehe. My gf likes it without ghosts Ok, I finally have all my ghost models! Here's my tight code to produce 64 different ghosts (16*4) expandcollapse popupGlobal Const $BLINKY = 0 Global Const $PINKY = 1 Global Const $INKEY = 2 Global Const $CLYDE = 3 Global Const $STATE_DEAD = 0 Global Const $STATE_BLUE = 1 Global Const $STATE_PINK = 2 Global Const $STATE_CHASE = 3 HotKeySet("{ESC}","_exit") Opt("GUICloseOnESC",1) Opt("GUIOnEventMode", 1) ;;;;;;;;;;graphics Global Const $GUI_GR_CLOSE = 1 Global Const $GUI_GR_LINE = 2 Global Const $GUI_GR_BEZIER = 4 Global Const $GUI_GR_MOVE = 6 Global Const $GUI_GR_COLOR = 8 Global Const $GUI_GR_RECT = 10 Global Const $GUI_GR_ELLIPSE = 12 Global Const $GUI_GR_PIE = 14 Global Const $GUI_GR_DOT = 16 Global Const $GUI_GR_PIXEL = 18 Global Const $GUI_GR_HINT = 20 Global Const $GUI_GR_REFRESH = 22 Global Const $GUI_GR_PENSIZE = 24 Global Const $GUI_GR_NOBKCOLOR = -2 ;; 0=x, 1=y, 2=state[ 0=dead, 1=blue, 2=normal, 3=chasing], 3=following a predefined path Global $Ghosts[4][4] = [[109,114,0,0],[109,138,0,0],[93,138,0,0],[125,138,0,0]] Global $Ghostb[4][3][6]; 64 ghost bodies. bleh Global $GBOTTOM = 0; toggle bottom crap ;~ junk Global $guiname = "testcrap ghosts" Global $eyearr[5] = [fastarr(0,0,4,4,0), fastarr(2,1,3,1,0), fastarr(3,3,5,5,0), fastarr(2,4,3,7,0), fastarr(1,3,1,5,0)] Global $bottomarr[3] = [StringSplit("2,6,7,11,1,2,3,6,7,10,11,12",","),StringSplit("4,9,0,3,4,5,8,9,10,13",","),StringSplit("2,3,6,7,10,11,1,4,5,8,9,12",",")] ;~ these r in teh other script Func fastarr($a,$b,$c,$d,$e) Local $temp[5]=[$a,$b,$c,$d,$e]; array functionality must be the biggest challenge when making a new language. Return $temp EndFunc Func fastarr2($a,$B) Local $temp[2]=[$a,$b]; array functionality must be the biggest challenge when making a new language. Return $temp EndFunc Func Iif ($x,$y,$z) If $x Then Return $y Return $z EndFunc Func game_initialize() Global $gui = GUICreate ( $guiname, 560, 160, -1, -1, 0x80000000+0x00800000 ) GUISetBkColor(0x000000) ;; bottoms x2 + no eyes ;; eyes x 4 ;; no eyes ;; blue ;[2,5,3,7] ; funny shocked eyes makeghosts() Local $x = 25 Local $y = 25 for $ghost = $BLINKY to $CLYDE ;~ Global $Ghostb[4][3][6]; 64 ghost bodies. bleh for $ii = 0 to 5 for $i = 0 to 2 $id = $Ghostb[$ghost][$i][$ii] GUICtrlSetPos( $id, $x, $y) $x += 30 Next Next $y += 30 $x = 25 Next GUISetState() EndFunc game_initialize() Func makeghosts() Local $colors[4] = [ 0xFF0000, 0xFFB8DE, 0x00FFDE, 0xFFB847 ] Local $blues[4] = [ 0x3333CC, 0xFFFFFF, 0xFFEEEE, 0xFF0000 ] For $ghost = $BLINKY to $CLYDE ;;; 4 ghosts For $i = 1 to 4; 4 eye positions $ids = makebody($colors[$ghost]) For $ii = 0 to 1 ; 2 bottom wiggly things.. $Ghostb[$ghost][$ii][$i] = $ids[$ii] makeeyes( $ids[$ii], $i ) Next $id = GUICtrlCreateGraphic(0, -50, 14, 14); make eyes w no body makeeyes ($id, $i) $Ghostb[$ghost][2][$i] = $id Next ;blue edible ghosts. blue / For $i = 0 to 1; - 2 shades $ids = makebody( $blues[$i] ) For $ii = 0 to 1; 2 bottoms makeeyes( $ids[$ii], 0, $blues[$i+2] ) $Ghostb[$ghost][$ii][$i*5] = $ids[$ii] Next Next Next EndFunc Func makebody( $color ) Local $arr[2] for $i = 0 to 1 $arr[$i] = GUICtrlCreateGraphic(0, -50, 14, 14) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, $color,$color) GUICtrlSetGraphic(-1,$GUI_GR_ELLIPSE, 0,0, 14, 15) GUICtrlSetGraphic(-1,$GUI_GR_RECT, 0,10, 14, 4) GUICtrlSetGraphic(-1,$GUI_GR_COLOR, 0x000000, 0x000000) GUICtrlSetGraphic(-1,18, 0, 5) GUICtrlSetGraphic(-1,18, 13, 5) GUICtrlSetGraphic(-1,$GUI_GR_RECT, 5, 14, 4, 1) makebottom($arr[$i], $i) Next Return $arr EndFunc Func makeeyes($id, $type, $color = 0x2121DE) $a = $eyearr[$type] If $type Then $b = 6 GUICtrlSetGraphic($id, $GUI_GR_COLOR, 0xDEDEDE, 0xDEDEDE) GUICtrlSetGraphic($id, $GUI_GR_ELLIPSE, $a[0], $a[1], 4, 5) GUICtrlSetGraphic($id, $GUI_GR_ELLIPSE, $a[0]+$b, $a[1], 4, 5) GUICtrlSetGraphic($id, $GUI_GR_COLOR, $color, $color) Else $b = 4 makebottom($id, 2, $color) EndIf;0xFFCC99 GUICtrlSetGraphic($id,$GUI_GR_COLOR, $color, $color) GUICtrlSetGraphic($id,$GUI_GR_ELLIPSE, $a[2], $a[3], 2, 2) GUICtrlSetGraphic($id,$GUI_GR_ELLIPSE, $a[2]+$b, $a[3], 2, 2) EndFunc Func makebottom($id, $type, $color = 0x000000) $a = $bottomarr[$type] $y = Iif ($type == 2, 8, 12) GUICtrlSetGraphic($id,$GUI_GR_COLOR, $color, $color) For $i = 1 to $a[0] If $a[$i] < 2 Then $y += 1 GUICtrlSetGraphic( $id, 18, $a[$i], $y) Next EndFunc while 1 sleep(50) WEnd Func _exit() Exit EndFunc I'm sure there's not a more efficient way to make and manage all these ghost models. One time I got a shocked looking ghost by accident, and I'm thinking about using this when the ghost kills Pac-Man.. Like he's saying "Wow. I can't believe I got him!! I win.. gg!" Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player Link to comment Share on other sites More sharing options...
Paulie Posted March 10, 2007 Share Posted March 10, 2007 When you finish this, Its going to be really incredible. Very nice job. Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted March 10, 2007 Share Posted March 10, 2007 cool!, also very interesting how u used no images, and no extra librarys.. Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
Ed_Maximized Posted March 11, 2007 Share Posted March 11, 2007 I like it!!! keep going!!! ShapedGUI Creator : Shaped gui the easy way!!!Txt2au3 : the easy way to include text files into your program without fileinstall_GUICreateWithTiledBackground : Put a GIF in the background of your formsSQLite Database BrowserAnimated GIF UDF : Put animations in your GUI's Link to comment Share on other sites More sharing options...
NELyon Posted March 11, 2007 Share Posted March 11, 2007 Wow... This amazes me so much. Not using one single image... Just wow. I now realize how much Autoit can do at it's full potential. While reading the above comment, think of some dramatic adventure music. That is what i was thinking when i typed that. Link to comment Share on other sites More sharing options...
rush4hire Posted March 11, 2007 Author Share Posted March 11, 2007 (edited) I made some good progress today. I was really stuck on the pac-man moving bug. It was so simple it baffled me. I updated my first post.This script I posted is super fast. I started with a refresh rate of every 70 ms and kept going faster. I felt 40 ms was pretty good. But I decided to try 10 ms for kicks and I'm surprised at the performance.But I don't know how it will work when the ghosts will be moving all over.And if you go to 5 ms it seems to be almost the same as 10 ms..Maybe if someone wants to train to be a professional pac-man player, he can use this in fast mode. lol.. Hey, I'm into it. I got #4 high score in the dota-allstars.com arcade [note]If you want to see the levels change real fast for a demo, change this"Global $LEVEL_DEMO_MODE = FalseoÝ÷ ÚÚºÚ"µÍÛØ[ ÌÍÓUSÑSS×ÓSÑHHY-- oh ya --You can also change this:Global $ANIMODE = Falseto TrueAnd you will see the the map being made. Edited March 11, 2007 by rush4hire Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player Link to comment Share on other sites More sharing options...
Paulie Posted March 11, 2007 Share Posted March 11, 2007 I found grapes!maybe they are too big, but they might work.P.S.- I have a book that came with my pac-man arcade game. It explains how all the ghosts move.Let me know if you want it Link to comment Share on other sites More sharing options...
rush4hire Posted March 12, 2007 Author Share Posted March 12, 2007 Thanks. I can live without grapes. But it would be nice to have more sounds.So this book you have explains the patterns of the ghosts ? Not how it's coded, but their behavior? Like if you get within a certain range of a ghost he starts following you, and like if you eat a certain number of dots the ghosts start moving faster and that number decreases with each level? What is that number? And how much faster do the ghosts move each level?I know how long they stay blue decreases with each level, but I have no idea how much.But more than these things I need the background music. And the music when it gets faster, and the music when it's time to eat ghosts...I got sounds from here http://pac-man.classicgaming.gamespy.com/Sounds/I got pics from wikipedia and http://www.iconarchive.com/icon/game/arcad...ence/index.html Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player Link to comment Share on other sites More sharing options...
rush4hire Posted March 13, 2007 Author Share Posted March 13, 2007 Everything works great now as far as I can tell. The ghosts are insane! But laggy... Of course I have a TODO list. Here it is: ;TODO ;fix graphic laggg ;fix fruit behavior ;fix occasional ghost leaving the screen ;find a better way for ghosts to chase pacman (can be complex) ;Opening page / scene and intermission cinimatics ;Game Over cinimatic ;high score system ;one of those right click menus Should be easy. Now I'm checking out ProSpeed. Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player Link to comment Share on other sites More sharing options...
WeMartiansAreFriendly Posted March 13, 2007 Share Posted March 13, 2007 Everything works great now as far as I can tell.The ghosts are insane! But laggy... Of course I have a TODO list. Here it is:;TODO;fix graphic laggg;fix fruit behavior;fix occasional ghost leaving the screen;find a better way for ghosts to chase pacman (can be complex);Opening page / scene and intermission cinimatics;Game Over cinimatic;high score system;one of those right click menusShould be easy.Now I'm checking out ProSpeed.i'm lost where is the latest version? Don't bother, It's inside your monitor!------GUISetOnEvent should behave more like HotKeySet() Link to comment Share on other sites More sharing options...
rush4hire Posted March 13, 2007 Author Share Posted March 13, 2007 I also updated the first post here. But the ugly home page should also have the latest. It's ok, but like I just said, it's so laggy. It seems all the time to make everything with graphics functions was a waste if I have to use something like ProSpeed.dll because it uses image files only. But it's cool. I'm glad I discovered ProSpeed. This gives me hope that I can make some other games too. I want to program in flash, but it's too expensive for me. Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player Link to comment Share on other sites More sharing options...
Lakes Posted March 14, 2007 Share Posted March 14, 2007 Good luck with making a Pacman version with ProSpeed, I`m still working on my (almost complete now) breakout game, but the level indecator I`ve added has introduced a bug with the display of the bricks after level 15, so I need to fix that now... 2015 - Still no flying cars, instead blankets with sleeves. Link to comment Share on other sites More sharing options...
rush4hire Posted March 14, 2007 Author Share Posted March 14, 2007 Of course there will be a few bugs. It's brand new. But that red ghost comes back at the next level. It's pretty good for how much time has gone into it. How much time did it take to develope the origional pac-man in the 70s? And how much code? I'm sure it was much more redundant than this script. It's less than 1200 lines and 35 kb! But my main thing now is to redo the whole thing by using prospeed.dll somehow.. Then I will fix those bugs and do the other things. Decompilable game code manager for Dark Deeds 6 for Warcraft IIIA web broadcast TiVo like thing.. (this example is for 3abn.org)Finally.. AutoIt Pac-Man Digital Hymn Player Link to comment Share on other sites More sharing options...
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