Sign in to follow this  
Followers 0
JonnyThunder

Button Snake [Game] v2.0! - NOW WITH LEVEL PLAY!

44 posts in this topic

#1 ·  Posted (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.1

  • Tidied 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 positions
  • You now start the game with the full snake on display
  • Snake starting position is relative to the initial direction chosen in variables, and it's position on the grid
EDIT #2 (30th March - afternoon) - Version 1.2

  • Gave the snake a definable body and head character so it was easier to see
  • Added 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 bar
  • Tweaked the default speed adjustments
EDIT #3 (30th March - later still in the afternoon) - Version 1.3

  • Can now press the END key to pause / unpause the game
  • You are now asked if you want to play again
  • Documented the variables at the top of the script
  • Tidied up a bit so that people can understand the layout
EDIT #4 (31st March - morning) - Version 1.4

  • Added a new 'termites' function to the game.
  • Added a custom snake icon supplied by Jackit
EDIT #5 (31st March - morning again) - Version 1.4.1

  • Fixed a bug with the termites breaking
  • Added instructions for play (Jackit)
  • Added Singleton (Jackit)
  • Switched off tray icon (Jackit)
EDIT #6 (31st March - evening) - Version 1.4.2

  • Removed snake character textures
  • Added in full snake colour! (thanks Fabry!)
MAJOR EDIT #7 (1st April) - Version 2.0

  • Changed so many things I can't even think!
  • Added sound clips
  • Added two game modes (freemode and Levels)
  • Added front menu
  • Now have control over level difficulty
  • Now can switch off termites at the front page
  • Fixed numerous bugs (mostly caused by myself)
  • Included compiled version and source, along with support files

ButtonSnakev2.0.zip

Edited by JonnyThunder

Share this post


Link to post
Share on other sites



#2 ·  Posted (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! :)

; <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 by Nooblet

code

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

#4 ·  Posted (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...

post-30516-1206841278_thumb.png

Edited by R6V2

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

#6 ·  Posted (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

; <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 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.)

Share this post


Link to post
Share on other sites

Your version is buggyer!!! At random times, it says: You've crashed into your tail...im like...wtf?

Share this post


Link to post
Share on other sites

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.)

Share this post


Link to post
Share on other sites

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? :party:

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!

Share this post


Link to post
Share on other sites

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.)

Share this post


Link to post
Share on other sites

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.)

Share this post


Link to post
Share on other sites

Nice job for beginner! I like it! :)

Share this post


Link to post
Share on other sites

He he he... i found a bug:

Posted Image

:)

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

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!

Share this post


Link to post
Share on other sites

Updated it again to Version 1.2. Makes it a bit more fun!

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Done.

File updated to version 1.3

I've added a pause hotkey and a 'restart' type deal.

:-)

Edited by JonnyThunder

Share this post


Link to post
Share on other sites

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.)

Share this post


Link to post
Share on other sites

#19 ·  Posted (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!

post-33330-1206946844_thumb.jpg

Edited by JonnyThunder

Share this post


Link to post
Share on other sites

#20 ·  Posted (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 by JonnyThunder

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  
Followers 0