JonnyThunder Posted March 29, 2008 Share Posted March 29, 2008 (edited) Hello,I was bored, so I wanted to see if I could recreate the classic snake game without using any real graphics or GD functions, and I came up with this. It's very basic - but pretty responsive. I thought maybe someone would like to take this basic outline and add to it to make it into a fully loaded game. I don't really have enough time to do anything else with it, and it did only take a couple of hours to write. It's dynamic in as much as, you can specify the dimensions of the game grid, the snake segments and the speed. The rest is automatic.Simply use the arrow keys to guide the snake around and collect the numbers. Every time you do, your tail will increase in size. Watch out that you don't crash into your tail or the walls - cos thats certain death! Also, new in version 1.4 - if you have Termites switched on, you'll randomly have a termite appear on your tail somewhere. You must click this with the mouse to remove it. Any termite left too long (the end of your tail) will end the game.Please please, post comments on the coding of this. It's a very lightweight bit of scripting but I only started learning AutoIT3 a couple of weeks ago and am interested in better ways of writing.---------------------------------------------------EDIT #1 (30th March - morning) - Version 1.1Tidied up the issues I was having with collision detection! Numbers should never appear on the tail now!Tidied up my use of arrays (and their numbering for storing snake tail positionsYou now start the game with the full snake on displaySnake starting position is relative to the initial direction chosen in variables, and it's position on the gridEDIT #2 (30th March - afternoon) - Version 1.2Gave the snake a definable body and head character so it was easier to seeAdded an automatic speedup - based on how many apples you've munched!Added full colour front-end with directX integration and 5.1 surroundsound! (I didn't really. Just wanted to make you go ... woah!)Added scoreboard and speed in title barTweaked the default speed adjustmentsEDIT #3 (30th March - later still in the afternoon) - Version 1.3Can now press the END key to pause / unpause the gameYou are now asked if you want to play againDocumented the variables at the top of the scriptTidied up a bit so that people can understand the layoutEDIT #4 (31st March - morning) - Version 1.4Added a new 'termites' function to the game.Added a custom snake icon supplied by JackitEDIT #5 (31st March - morning again) - Version 1.4.1Fixed a bug with the termites breakingAdded instructions for play (Jackit)Added Singleton (Jackit)Switched off tray icon (Jackit)EDIT #6 (31st March - evening) - Version 1.4.2Removed snake character texturesAdded in full snake colour! (thanks Fabry!)MAJOR EDIT #7 (1st April) - Version 2.0Changed so many things I can't even think!Added sound clipsAdded two game modes (freemode and Levels)Added front menuNow have control over level difficultyNow can switch off termites at the front pageFixed numerous bugs (mostly caused by myself)Included compiled version and source, along with support filesButtonSnakev2.0.zip Edited April 1, 2008 by JonnyThunder Link to comment Share on other sites More sharing options...
DexterMorgan Posted March 29, 2008 Share Posted March 29, 2008 (edited) Hello, I was bored, so I wanted to see if I could recreate the classic snake game without using any real graphics or GD functions, and I came up with this. It's very basic - but pretty responsive. I thought maybe someone would like to take this basic outline and add to it to make it into a fully loaded game. I don't really have enough time to do anything else with it, and it did only take a couple of hours to write. It's dynamic in as much as, you can specify the dimensions of the game grid, the snake segments and the speed. The rest is automatic. The only real annoyance is that when an 'apple' appears (the number you eat), it can reappear on the tail of the snake. Oddly, I did write a check in for this originally - but found that if I randomly generated the location and it overlapped the snakes tail a few times in a row, the random number generator started spitting out ONLY numbers that were in the snakes tail. Very odd indeed. Seeding the random number didn't help either. Anyway, for your amusement - here's the code. Hopefully someone will adopt it and make it into something great! expandcollapse popup; <BUTTONSNAKE.au3> GUI Button Snake Game v1.0 ; by JonnyThunder (29th March, 2008) ; A classic snake style game written using AutoIT3 GUI functions ; -- SORT OUT MY INCLUDES. I LOVE MY INCLUDES. -------------------------- #include <Constants.au3> #include <GuiConstantsEx.au3> #include <Array.au3> ; -- DEFINE THE GAME VARIABLES ------------------------------------------ $snake_start_length = 10 $snake_start_speed = 100 $snake_start_direction = 4 $snake_segment_size_x = 15 $snake_segment_size_y = 15 $grid_max_x = 25 $grid_max_y = 25 $grid_start_position_x = 10 $grid_start_position_y = 10 $apple_min = 2 $apple_max = 9 ; -- INITIALISE THE GAME VARIABLES -------------------------------------- $length = $snake_start_length ; Holds the length of the worm waiting to be shown $current_length = 0 ; Holds the actual current length of snake being shown $speed = $snake_start_speed $direction = 4 ; 1 = up, 2 = down, 3 = left, 4 = right $position_x = $grid_start_position_x ; Holds current position of snake head X $position_y = $grid_start_position_y ; Holds current position of snake head Y $pressed = false $apple = False $current_apple = 0 $current_apple_x = -1 $current_apple_y = -1 Dim $snake_button_handle[1], $snake_button_x[1], $snake_button_y[1] ; -- INITIALISE THE GAMEGRID -------------------------------------------- $gamegrid = GuiCreate ( "ButtonSnake", ($grid_max_x * $snake_segment_size_x), ($grid_max_y * $snake_segment_size_y) ) GuiSetState() ; -- SET UP THE HOTKEYS ------------------------------------------------- HotKeySet( "{UP}", "key_up" ) HotKeySet( "{DOWN}", "key_down" ) HotKeySet( "{LEFT}", "key_left" ) HotKeySet( "{RIGHT}", "key_right" ) ; -- MAIN PROGRAM LOOP -------------------------------------------------- $timer = TimerInit() While 1 ; -- TIMED UPDATES -------------------------------------------------- if TimerDiff ( $timer ) > $speed Then ; -- INCREMENT MOVEMENTS ---------------------------------------- If $direction = 1 Then $position_y = $position_y - 1 EndIf If $direction = 2 Then $position_y = $position_y + 1 EndIf if $direction = 3 Then $position_x = $position_x - 1 EndIf if $direction = 4 Then $position_x = $position_x + 1 EndIf ; -- CHECK WALL COLLISION --------------------------------------- if $position_x > $grid_max_x or $position_x < 1 or $position_y > $grid_max_y or $position_y < 1 Then msgbox (64, "End of game!", "You crashed into a wall!" & @LF & @LF & "Your tail length was " & $current_length) Exit EndIf ; -- CHECK TAIL COLLISION --------------------------------------- for $chk = 1 to $current_length if $position_x = $snake_button_x[$chk] and $position_y = $snake_button_y[$chk] Then msgbox (64, "End of game!", "You crashed into your tail!" & @LF & @LF & "Your tail length was " & $current_length) Exit EndIf Next ; -- IF SNAKE ISNT AT LENGTH THEN JUST ADD ---------------------- if $current_length < $length Then $current_length = $current_length + 1 _ArrayAdd ( $snake_button_handle, "" ) _ArrayAdd ( $snake_button_x, $position_x ) _ArrayAdd ( $snake_button_y, $position_y ) ; -- IF SNAKE IS AT LENGTH THEN ADD AND REMOVE LAST SEGMENT ----- Else ;$current_length = $length Then GuiCtrlDelete ( $snake_button_handle[1] ) _ArrayPush ( $snake_button_handle, "" ) _ArrayPush ( $snake_button_x, $position_x ) _ArrayPush ( $snake_button_y, $position_y ) EndIf ; -- ADD A NEW SEGMENT TO THE START OF THE WORM ----------------- $snake_button_handle[$current_length] = GUICtrlCreateButton( "X", (($position_x-1)*$snake_segment_size_x), (($position_y-1)*$snake_segment_size_y), $snake_segment_size_x, $snake_segment_size_y ) ; -- CREATE A NEW APPLE ----------------------------------------- if $current_length = $length and not $apple Then $apple = True $current_apple = random($apple_min, $apple_max, 1) $current_apple_x = random(1, $grid_max_x, 1) $current_apple_y = random(1, $grid_max_y, 1) $current_apple_handle = GuiCtrlCreateLabel( $current_apple, (($current_apple_x-1)*$snake_segment_size_x)+1, (($current_apple_y-1)*$snake_segment_size_y)+1, $snake_segment_size_x, $snake_segment_size_y ) EndIf ; -- CHECK IF SNAKIE HAS EATEN THE APPLE ------------------------ if $position_x = $current_apple_x and $position_y = $current_apple_y Then $apple = False GuiCtrlDelete($current_apple_handle) $length = $length + $current_apple EndIf ; -- RESET THE TIMER -------------------------------------------- $timer = TimerInit() $pressed = False EndIf ; -- CHECK FOR ADDITIONAL KEYPRESSES -------------------------------- $msg = GuiGetMsg() if $msg = $GUI_EVENT_CLOSE then ExitLoop WEnd ; -- DELETE THE GAMEGRID ------------------------------------------------ GUIDelete ($gamegrid) ; -- SET UP THE KEYPRESSES ---------------------------------------------- Func key_up () if $direction <> 2 and not $pressed Then $direction = 1 $pressed = true EndIf EndFunc Func key_down () if $direction <> 1 and not $pressed Then $direction = 2 $pressed = true EndIf EndFunc Func key_left () if $direction <> 4 and not $pressed Then $direction = 3 $pressed = true EndIf EndFunc Func key_right () if $direction <> 3 and not $pressed Then $direction = 4 $pressed = true EndIf EndFunc Please please, post comments on the coding of this. It's a very lightweight bit of scripting but I only started learning AutoIT3 a couple of weeks ago and am interested in better ways of writing. Very cool game I love it! My high score is Edit: 80 Edited March 29, 2008 by Nooblet code Link to comment Share on other sites More sharing options...
monoceres Posted March 29, 2008 Share Posted March 29, 2008 Really nice for being a beginner Your code is also really nice and clean, no spagethi there Broken link? PM me and I'll send you the file! Link to comment Share on other sites More sharing options...
Swift Posted March 29, 2008 Share Posted March 29, 2008 (edited) Wow, it's funny that it makes buttons, but its awesome! My score is 107...hit my tail ...lol EDIT: 110, hit the wall... Edited March 30, 2008 by R6V2 Link to comment Share on other sites More sharing options...
DexterMorgan Posted March 30, 2008 Share Posted March 30, 2008 you should make it that if you click the right button something special happens!! lol it would be cool imagine you have like 70 buttons and your trying not to hit yourself and clicking every button you click the wrong on you automatically die!!! muhahaha i would like that (i would do it myself but im a little nooblet!!) code Link to comment Share on other sites More sharing options...
crashdemons Posted March 30, 2008 Share Posted March 30, 2008 (edited) I did some edits to it - and sometimes the tail is slightly buggy, but it's fun. +apples can be bombs now (editable %chance) +apple respawn timer (if you don't eat the apple before 'x' seconds are up) +game doesn't exit when you "die", (instead you get the message and then start over with a length of 1) +pause game with the Pause key (pause with messagebox to see current length) EDIT: +editable bomb cost (how many tail pieces to lose if you eat a bomb) +fixed some "dead tail piece" bugs EDIT: -- Accidentally left the "Bomb %chance" at 100% - changed to 50% -- Fixed some errors + stopped clearing entire tail when eating bomb, instead it seperates and dies expandcollapse popup; <BUTTONSNAKE.au3> GUI Button Snake Game v1.0 ; by JonnyThunder (29th March, 2008) ; A classic snake style game written using AutoIT3 GUI functions Opt("GUIOnEventMode",1) ; -- SORT OUT MY INCLUDES. I LOVE MY INCLUDES. -------------------------- #include <Constants.au3> #include <GuiConstantsEx.au3> #include <Array.au3> ; -- DEFINE THE GAME VARIABLES ------------------------------------------ $snake_start_length = 10 $snake_start_speed = 100 $snake_start_direction = 4 $snake_segment_size_x = 15 $snake_segment_size_y = 15 $grid_max_x = 25 $grid_max_y = 25 $grid_start_position_x = 10 $grid_start_position_y = 10 $apple_min = 2 $apple_max = 9 $apple_respawn_delay = 5000; time between automatic apple/bomb respawns (from last apple spawn) $apple_bomb_chance =(1/2); the percent (decimal) chance to get a bomb to respawn $bomb_tail_cost = 3 ; how much of the tail to lose when you eat a bomb ; -- INITIALISE THE GAME VARIABLES -------------------------------------- $length = $snake_start_length ; Holds the length of the worm waiting to be shown $current_length = 0 ; Holds the actual current length of snake being shown $speed = $snake_start_speed $direction = 4 ; 1 = up, 2 = down, 3 = left, 4 = right $position_x = $grid_start_position_x ; Holds current position of snake head X $position_y = $grid_start_position_y ; Holds current position of snake head Y $pressed = false $apple = False $snake_alive =true;death / game restart switch $current_apple = 0 $current_apple_x = -1 $current_apple_y = -1 $apple_timer = TimerInit() $apple_bomb_chance = 1 - $apple_bomb_chance $grid_close = false Dim $snake_button_handle[1], $snake_button_x[1], $snake_button_y[1] ; -- INITIALISE THE GAMEGRID -------------------------------------------- $gamegrid = GuiCreate ( "ButtonSnake", ($grid_max_x * $snake_segment_size_x), ($grid_max_y * $snake_segment_size_y) ) GUISetOnEvent($GUI_EVENT_CLOSE,"_close") GuiSetState() ; -- SET UP THE HOTKEYS ------------------------------------------------- HotKeySet( "{UP}", "key_up" ) HotKeySet( "{DOWN}", "key_down" ) HotKeySet( "{LEFT}", "key_left" ) HotKeySet( "{RIGHT}", "key_right" ) HotKeySet( "{PAUSE}", "pause_game" ) ; -- MAIN PROGRAM LOOP -------------------------------------------------- $timer = TimerInit() While 1 ; -- TIMED UPDATES -------------------------------------------------- if TimerDiff ( $timer ) > $speed Then ReBound_Arrays() ; -- INCREMENT MOVEMENTS ---------------------------------------- If $direction = 1 Then $position_y -= 1 If $direction = 2 Then $position_y += 1 if $direction = 3 Then $position_x -= 1 if $direction = 4 Then $position_x += 1 ; -- CHECK IF ATE DEADLY BOMB --------------------------------------- If $snake_alive==false Then msgbox (64, "Oops!", "You ate a deadly bomb!" & @LF & @LF & "Your tail length was " & $current_length& @LF & @LF &'(snake debug: '&$position_x&','&$position_y&')') EndIf ; -- CHECK WALL COLLISION --------------------------------------- if $position_x > $grid_max_x or $position_x < 1 or $position_y > $grid_max_y or $position_y < 1 Then $snake_alive=false ;$current_length=1 msgbox (64, "Oops!", "You crashed into a wall!" & @LF & @LF & "Your tail length was " & $current_length& @LF & @LF &'(snake debug: '&$position_x&','&$position_y&')') ; Exit EndIf ; -- CHECK TAIL COLLISION --------------------------------------- for $chk=5 to $current_length-1 ; start at 5 ; -it's technically impossible to move the first block to where the (2 - 4)th blocks are ; without ripping the snake apart or moving diagonally if $position_x = $snake_button_x[$chk] and $position_y = $snake_button_y[$chk] Then $snake_alive=false ;$current_length=1 msgbox (64, "Oops!", "You crashed into your tail!" & @LF & @LF & "Your tail length was " & $current_length& @LF & @LF &'(snake debug: '&$position_x&','&$position_y&')'& @LF &'(tail debug['&$chk&']: '&$snake_button_x[$chk]&','&$snake_button_y[$chk]&')'&@LF&GUICtrlGetHandle($snake_button_handle[$chk])) ;Exit EndIf Next If $snake_alive=false Then $snake_alive=True $position_x=10 $position_y=10 $direction=4 DeleteButton(UBound($snake_button_handle)-1) $length=$snake_start_length EndIf ReBound_Arrays() Select Case $current_length < $length $current_length = $current_length + 1 _ArrayAdd ( $snake_button_handle, "" ) _ArrayAdd ( $snake_button_x, $position_x ) _ArrayAdd ( $snake_button_y, $position_y ) Case ($current_length > $length) For $i=$current_length To $length+1 Step -1 GUICtrlDelete($snake_button_handle[$i]) _ArrayDelete($snake_button_handle,$i) _ArrayDelete($snake_button_x,$i) _ArrayDelete($snake_button_y,$i) Next ReBound_Arrays() $length=$current_length Case ($current_length = $length) and $snake_alive If (UBound($snake_button_handle)-1)>=1 Then GuiCtrlDelete ( $snake_button_handle[0] ) GuiCtrlDelete ( $snake_button_handle[1] ) _ArrayPush ( $snake_button_handle, "" ) _ArrayPush ( $snake_button_x, $position_x ) _ArrayPush ( $snake_button_y, $position_y ) EndIf EndSelect ;ReBound_Arrays() ; -- ADD A NEW SEGMENT TO THE START OF THE WORM ----------------- GUICtrlDelete($snake_button_handle[$current_length]) $snake_button_handle[$current_length] = GUICtrlCreateButton('~', (($position_x-1)*$snake_segment_size_x), (($position_y-1)*$snake_segment_size_y), $snake_segment_size_x, $snake_segment_size_y ) $snake_button_x[$current_length]=$position_x $snake_button_y[$current_length]=$position_y ; -- CREATE A NEW APPLE ----------------------------------------- If TimerDiff($apple_timer)>$apple_respawn_delay Then $apple = False GuiCtrlDelete($current_apple_handle) EndIf if $current_length = $length and not $apple Then $apple = True $apple_timer=TimerInit() $current_apple = random($apple_min, $apple_max, 1) $is_apple_bomb = Random(0,1) If $is_apple_bomb>$apple_bomb_chance Then $current_apple='B' $current_apple_x = random(1, $grid_max_x, 1) $current_apple_y = random(1, $grid_max_y, 1) $current_apple_handle = GuiCtrlCreateLabel( $current_apple, (($current_apple_x-1)*$snake_segment_size_x)+1, (($current_apple_y-1)*$snake_segment_size_y)+1, $snake_segment_size_x, $snake_segment_size_y ) EndIf ; -- CHECK IF SNAKIE HAS EATEN THE APPLE ------------------------ if $position_x = $current_apple_x and $position_y = $current_apple_y Then $apple = False GuiCtrlDelete($current_apple_handle) $length = $length + $current_apple If $current_apple=='B' Then $length-=$bomb_tail_cost If $length<1 Then $snake_alive=false EndIf ; -- RESET THE TIMER -------------------------------------------- $timer = TimerInit() $pressed = False EndIf ; -- CHECK FOR ADDITIONAL KEYPRESSES -------------------------------- If $grid_close Then ExitLoop WEnd ; -- DELETE THE GAMEGRID ------------------------------------------------ GUIDelete ($gamegrid) Func DeleteButton($number_of_buttons) ConsoleWrite(@CRLF&"DeleteButton "&$number_of_buttons) For $i=$number_of_buttons To 0 Step -1 If $i>$current_length Then ContinueLoop ;If $i<1 Then ExitLoop ConsoleWrite(@CRLF&" Delete "&$i) GUICtrlDelete($snake_button_handle[$i]) $snake_button_x[$i]=-1 $snake_button_y[$i]=-1 _ArrayDelete($snake_button_handle,$i) _ArrayDelete($snake_button_x,$i) _ArrayDelete($snake_button_y,$i) $current_length-=1 sleep(10) Next $current_length=UBound($snake_button_handle) EndFunc Func ReBound_Arrays() $h_max=UBound($snake_button_handle)-1 $x_max=UBound($snake_button_x)-1 $y_max=UBound($snake_button_y)-1 $max_max=$h_max If $x_max>$max_max Then $max_max=$x_max If $y_max>$max_max Then $max_max=$y_max For $i=0 To $max_max If $i>$h_max Or $i>$x_max Or $i>$y_max Then If $i<=$h_max Then GUICtrlDelete($i) _ArrayDelete($snake_button_handle,$i) _ArrayDelete($snake_button_x,$i) _ArrayDelete($snake_button_y,$i) EndIf Next $h_max=UBound($snake_button_handle)-1 $current_length=$h_max EndFunc ; -- SET UP THE KEYPRESSES ---------------------------------------------- Func _close () $grid_close=true EndFunc Func pause_game () msgbox (64, "Game Pause", "The Game is Paused" & @LF& "Press OK to continue " & @LF & @LF & "Current Tail Length: "&$current_length& @LF & @LF &'(snake debug: '&$position_x&','&$position_y&')') EndFunc Func key_up () if $direction <> 2 and not $pressed Then $direction = 1 $pressed = true EndIf EndFunc Func key_down () if $direction <> 1 and not $pressed Then $direction = 2 $pressed = true EndIf EndFunc Func key_left () if $direction <> 4 and not $pressed Then $direction = 3 $pressed = true EndIf EndFunc Func key_right () if $direction <> 3 and not $pressed Then $direction = 4 $pressed = true EndIf EndFunc Edited March 30, 2008 by crashdemons My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.) Link to comment Share on other sites More sharing options...
Swift Posted March 30, 2008 Share Posted March 30, 2008 Your version is buggyer!!! At random times, it says: You've crashed into your tail...im like...wtf? Link to comment Share on other sites More sharing options...
crashdemons Posted March 30, 2008 Share Posted March 30, 2008 Your version is buggyer!!! At random times, it says: You've crashed into your tail...im like...wtf?Stop hitting your tail then But more seriously, I don't seem to be having the same problems when I try it ... could you look through it and give me a more helpful bug report? My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.) Link to comment Share on other sites More sharing options...
Swift Posted March 30, 2008 Share Posted March 30, 2008 Stop hitting your tail then But more seriously, I don't seem to be having the same problems when I try it ... could you look through it and give me a more helpful bug report? Sure! Soon enough, Im working on a new version of Xenon file manager, because the original dude, make them .a3x files... so..i'm tring to fix that, and get it working again! Link to comment Share on other sites More sharing options...
crashdemons Posted March 30, 2008 Share Posted March 30, 2008 Sure! Soon enough, Im working on a new version of Xenon file manager, because the original dude, make them .a3x files... so..i'm tring to fix that, and get it working again!Okay - actually now I'm getting the problem too, but the funny thing is I get the problem in the original also.Ill look through it some more and see if I can pinpoint the source problem... My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.) Link to comment Share on other sites More sharing options...
crashdemons Posted March 30, 2008 Share Posted March 30, 2008 Sure! Soon enough, Im working on a new version of Xenon file manager, because the original dude, make them .a3x files... so..i'm tring to fix that, and get it working again!Try the one in my post now, I edited it.I think it was because the Current_Length wasn't being set to the actual visible length, and was allowing the hit-check to check array keys that weren't meant to be used. My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.) Link to comment Share on other sites More sharing options...
rasim Posted March 30, 2008 Share Posted March 30, 2008 Nice job for beginner! I like it! Link to comment Share on other sites More sharing options...
rasim Posted March 30, 2008 Share Posted March 30, 2008 He he he... i found a bug: Link to comment Share on other sites More sharing options...
JonnyThunder Posted March 30, 2008 Author Share Posted March 30, 2008 He he he... i found a bug:Ahhh but you didn't. I draw your attention then, to my original post which said....The only real annoyance is that when an 'apple' appears (the number you eat), it can reappear on the tail of the snake. Oddly, I did write a check in for this originally - but found that if I randomly generated the location and it overlapped the snakes tail a few times in a row, the random number generator started spitting out ONLY numbers that were in the snakes tail. Very odd indeed. Seeding the random number didn't help either. Link to comment Share on other sites More sharing options...
JonnyThunder Posted March 30, 2008 Author Share Posted March 30, 2008 Changed the script this morning to detect for what I specified in my last post. Have updated the file on the post - makes for a more enjoyable game! Link to comment Share on other sites More sharing options...
JonnyThunder Posted March 30, 2008 Author Share Posted March 30, 2008 Updated it again to Version 1.2. Makes it a bit more fun! Link to comment Share on other sites More sharing options...
JonnyThunder Posted March 30, 2008 Author Share Posted March 30, 2008 (edited) Done.File updated to version 1.3I've added a pause hotkey and a 'restart' type deal.:-) Edited March 30, 2008 by JonnyThunder Link to comment Share on other sites More sharing options...
crashdemons Posted March 31, 2008 Share Posted March 31, 2008 Still no "bombs" in the official release? My Projects - WindowDarken (Darken except the active window) Yahsmosis Chat Client (Discontinued) StarShooter Game (Red alert! All hands to battlestations!) YMSG Protocol Support (Discontinued) Circular Keyboard and OSK example. (aka Iris KB) Target Screensaver Drive Toolbar Thingy Rollup Pro (Minimize-to-Titlebar & More!) 2D Launcher physics example Ascii Screenshot AutoIt3 Quine Example ("Is a Quine" is a Quine.) USB Lock (Another system keydrive - with a toast.) Link to comment Share on other sites More sharing options...
JonnyThunder Posted March 31, 2008 Author Share Posted March 31, 2008 (edited) Lol.... not yet, no. But I was thinkin about introducing 'termites'. I figured that you could perhaps have a number appear on the snake tail which you have to click within a certain time period. Or perhaps a number which travels the length of the snake, and if you dont click it before it gets to the end - then it's end of game. Any ideas are appreciated! Edit: I got 263 on my first go this morning... snake-PRO! Edited March 31, 2008 by JonnyThunder Link to comment Share on other sites More sharing options...
JonnyThunder Posted March 31, 2008 Author Share Posted March 31, 2008 (edited) Ahhh, I just added a new version before seeing this. New in version 1.4 - if you have Termites switched on, you'll randomly have a termite appear on your tail somewhere. You must click this with the mouse to remove it. Any termite left too long (the end of your tail) will end the game. The function to quick-exit the game was already available (pressing ESC will bomb out immediately). Lovin' the icon though - its cool! If you don't mind, i'll attach it to my original post for those who want to compile it. Edit: Ahhh, I can't download from there. :-( Edited March 31, 2008 by JonnyThunder 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