CodyBarrett Posted November 25, 2008 Posted November 25, 2008 (edited) i think the title basically explains it.. but anyway im making a "SNAKE type of gui game based on arrow keymovments... and uhh i got the "FOOD" dot to reapear in a random place.. but how would i go about finding the current location of the "SNAKE" and adding pixels to it to make it move? this is my asic script (just started 30mins ago on this particualr project)expandcollapse popup;############### Writen By Bob00037 ###############: #include <GuiConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> HotKeySet("{UP}", "up") HotKeySet("{DOWN}", "down") HotKeySet("{LEFT}","left") HotKeySet("{RIGHT}","right") $SNAKE = GUICreate("SNAKE",500,500) $Ra = Random(10,490) GUISetBkColor(0x0C0C0C) $R = GUICtrlCreatePic("RED DOT.bmp",$Ra,$Ra, 10, 10) $W = GUICtrlCreatePic("WHITE DOT.bmp",10,10,10,10) GUISetState(@SW_SHOW) up() Func up() EndFunc down() Func down() EndFunc left() Func left() EndFunc right() Func right() EndFunc While GuiGetMsg() <> $GUI_EVENT_CLOSE $msg = GUIGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop EndSelect WEnd any ideas on a func for the current location? Edited November 25, 2008 by bob00037 [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
Achilles Posted November 25, 2008 Posted November 25, 2008 I did something like this in Java. What I would do is make a huge array of label controls and make them different colors. Or you could use images if you really want the objects to be circular. That way, when you create an apple, you can get it's coords, and each time you move, check the coords of the snake with the coords of the apple. My Programs[list][*]Knight Media Player[*]Multiple Desktops[*]Daily Comics[*]Journal[/list]
CodyBarrett Posted November 25, 2008 Author Posted November 25, 2008 what i really want is to make the SNAKE to start off moving downward like (GETPOS and then +10 pix) to the pos based on what key you press.. and IF 10000 milleseconds go by the red dot relocates... [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size]
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