This is a sample of code, that Unseen gave me, useing GDK, you also need to get, 'UnseenGDK_Pro.bm',
http://dl.dropbox.com/u/8822351/UnseenGDK_Pro.bmAnd should look at Unseens, wiki, to learn more on how to use GDK libraries, and in you code, I think, this is for more advanced "programmers",..but anyway, Unseen is available, to explain more.
http://code.google.com/p/unseen-gdk/And you need :
http://dl.dropbox.com/u/15387474/Hawk.bmp or you could make your own sprite.
------------------Code---------------
GDK_Start
GDK_SetScreenRes GameScreen, 600, 400, 32, 0
DIM Hawk AS GameObject, KbNow AS KeyBoardState
GDK_NewTexture Hawk.Image, "hawk.bmp", 4, 1, 4, 1
GDK_SetTextureVisibility Hawk.Image, -1
GDK_NewVector2D Hawk.Vector, 300, 350, 0, 0
HawkFrame% = 1
HawkDir% = 1 'Right
AnimTimer# = TIMER(.001)
DO
IF TIMER(.001) - AnimTimer# > .2 THEN
IF HawkDir% = 1 THEN
IF HawkFrame% = 1 THEN HawkFrame% = 2 ELSE HawkFrame% = 1
ELSE
IF HawkFrame% = 3 THEN HawkFrame% = 4 ELSE HawkFrame% = 3
END IF
AnimTimer# = TIMER(.001)
END IF
GDK_DrawTexture Hawk.Image, Hawk.Vector, HawkFrame%
GDK_GetKeyboardState KbNow
IF KbNow.Left THEN
IF Hawk.Vector.X > 0 THEN Hawk.Vector.X = Hawk.Vector.X - 1
HawkDir% = 2 'Left
IF HawkFrame% = 1 OR HawkFrame% = 2 THEN HawkFrame% = 3
ELSEIF KbNow.Right THEN
IF Hawk.Vector.X + (Hawk.Image.Width / 4) < 600 THEN Hawk.Vector.X = Hawk.Vector.X + 1
HawkDir% = 1 'Left
IF HawkFrame% = 3 OR HawkFrame% = 4 THEN HawkFrame% = 1
END IF
IF KbNow.Up THEN
IF Hawk.Vector.Y > 0 THEN Hawk.Vector.Y = Hawk.Vector.Y - 1
ELSEIF KbNow.Down THEN
IF Hawk.Vector.Y + Hawk.Image.Height < 400 THEN Hawk.Vector.Y = Hawk.Vector.Y + 1
END IF
_DISPLAY
CLS
LOOP
REM $INCLUDE:'UnseenGDK_Pro.bm'
TYPE GameObject
Image AS Texture
Vector AS Vector2D
Rect AS Rectangle
END TYPE
I hope later, Unseen will show how to add a object or the rabbit for the hawk to catch. And later I will post a version that includes the background.
Enjoy
Note: Unseens GDK, is still being developed, this sample is for UnseenGDK_Pro.bm and you need it to run the code. However he is now up a ver 3, Which can do even more,...if you are interested in this, follow the links shown above, to get the most current version, and more info.
from Garry