Weekly Qbasic and Qb64 Lesson Topics
March 29, 2024, 04:04:12 am
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Want to see a specific Tutorial? ASK!
 
  Home Help Search Arcade Links Staff List Login Register  

GDK Catch the Rabbit,but just the Hawk so far

Pages: [1]
  Print  
Author Topic: GDK Catch the Rabbit,but just the Hawk so far  (Read 841 times)
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« on: January 19, 2011, 10:41:21 pm »

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.bm
And 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---------------
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

« Last Edit: March 04, 2011, 11:27:36 pm by GarrisonRicketson » Report Spam   Logged

Share on Facebook Share on Twitter

GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #1 on: March 04, 2011, 11:37:02 pm »

I have the newer version, that Unseen helped me with, and also I will add the drop box link for the background, and the current version of GDK, can be gotten at the site listed above. Tommorow, or sunday...
from Garry
Report Spam   Logged

Dustie Bear
Full Member
***
Posts: 115


« Reply #2 on: March 10, 2011, 10:40:29 pm »


Hi

How do you use the unseen Gdk,

do you make it into a library or bI file?

courious minds want to know/

Thanks
Dustie

Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #3 on: March 11, 2011, 12:19:48 am »

Thats about it,but if you have any problems, or further questions, feel free to ask,  and if I can't answer it Then Unseen, should be able to since he deceloped it...
from Garry
P.S welcome Dusty
You should be able to download the packages at the above links.
« Last Edit: September 06, 2011, 08:06:35 pm by GarrisonRicketson » Report Spam   Logged

Dustie Bear
Full Member
***
Posts: 115


« Reply #4 on: March 11, 2011, 02:05:34 pm »


Thanks for the replys

Got it downloaded , will try it out when I learn a bit more about it.

thanks

Dusitie
Report Spam   Logged
Dustie Bear
Full Member
***
Posts: 115


« Reply #5 on: March 11, 2011, 07:46:32 pm »



 So is that just another name for a BI file,

If not, how do they differ?


Dustie

Inquiring mind wants to know. LOL
Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #6 on: September 06, 2011, 08:17:08 pm »

To be honest , I am not sure, BM is for basic make, useng include, and libraries, they are used,  don't know if BI is the same, but I think it works the same, Unseens tutorial goes into that.
Report Spam   Logged


Pages: [1]
  Print  
 
Jump to:  

Powered by EzPortal
Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum


Powered by SMF | SMF © 2016, Simple Machines
Privacy Policy