Weekly Qbasic and Qb64 Lesson Topics
April 19, 2024, 06:29:04 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  

Ghost n this GDK Demo

Pages: [1]
  Print  
Author Topic: Ghost n this GDK Demo  (Read 597 times)
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« on: March 18, 2011, 12:18:22 am »

I was "fooling around" trying to load my ghost sprite,(animation), I couldn't
remember, how with _putimage, so I used this GDK demo, that inseen had made for the hawk,...Note though, this was one of his earlier versiones of GDK, so you need the older , unseenGDK_pro.bm  , If yu don't have it see the drop box link below at bottom.
Code:
  GDK_Start
GDK_SetScreenRes GameScreen, 600, 400, 32, 0
DIM Hawk AS GameObject, KbNow AS KeyBoardState
GDK_NewTexture Hawk.Image, "NEWGHOST_blu1.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

   
And then here is the sprite sheet:
NEWGHOST_blu1 , image needed
http://dl.dropbox.com/u/15387474/newghost_blu1.bmp

I will be interested in if it works ,it worked pretty neat for me.
Enjoy
 here it is on DROPBOX :
unseenGDk_pro.bm
http://dl.dropbox.com/u/15387474/UnseenGDK_Pro.bm
And So, you can use this image too, you need to change this File name:
GDK_NewTexture Hawk.Image, "NEWGHOST_blu1.bmp", 4, 1, 4, 1
to
NEWGHOST_blu1.jpg
« Last Edit: March 18, 2011, 01:56:39 am by GarrisonRicketson » Report Spam   Logged

Share on Facebook Share on Twitter

OlDosLover
Guest
« Reply #1 on: March 18, 2011, 12:56:31 am »

Hi all,
    I carn't get it to work. Keep getting an error at line 40 which points to the BM file. My suggestion here Garry is to copy the BM file inside a quote into this thread. So you open the BM file in notepad, gighlight the entire text, copy and paster it here. Although i followed your instructions it didnt work for me.
OlDosLover.
Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #2 on: March 18, 2011, 01:18:28 am »

Hi all,
    I carn't get it to work. Keep getting an error at line 40 which points to the BM file. My suggestion here Garry is to copy the BM file inside a quote into this thread. So you open the BM file in notepad, gighlight the entire text, copy and paster it here. Although i followed your instructions it didnt work for me.
OlDosLover.



http://dl.dropbox.com/u/15387474/UnseenGDK_Pro.bm
it wouldn't fit, to many lines, I put it on drop box.

If you still have trouble, I think the best thing is to re-write,the program, to use, the newer version of GDK,....I think there may be some other issues here,...it is late for me,...if this still dose not work, I'll see in the moring..
sorry-
from Garry
Edit: SOLVED it, it was the image,..photo bucket converts it to JPG.....
USE THIS: 
http://dl.dropbox.com/u/15387474/newghost_blu1.bmp
I am also going to modify,edit the first one with the code, so much for photo bucket...bleh!
« Last Edit: March 18, 2011, 01:32:41 am by GarrisonRicketson » Report Spam   Logged

OlDosLover
Guest
« Reply #3 on: March 18, 2011, 01:18:55 am »

Hi all,
    Got it to work. The problem was that in the code the image is reffered to as a BMP but when you download the attached image its a jpg. Garry modify the code please to reflect this.
OlDosLover.
Report Spam   Logged
GarrisonRicketson
Admin
Administrator
Hero Member
*****
Posts: 583



WWW
« Reply #4 on: March 18, 2011, 01:51:48 am »

Hi all,
    Got it to work. The problem was that in the code the image is reffered to as a BMP but when you download the attached image its a jpg. Garry modify the code please to reflect this.
OlDosLover.

I thought about that,but then I wasn't sure, if qb64 or GDK would handle the JPG,...so I changed it all to drop box,....
 Anyway now I know for the future,.....or we,...
I need to get to sleep, ...or I'l be miserable tommorow,...
Thanks, for helping "test", and thats why it still worked for me,...cause I had the image as .bmp in my computer,...!
from Garry
Report Spam   Logged

OlDosLover
Guest
« Reply #5 on: March 18, 2011, 02:04:25 am »

Hi all,
    You got email Garry.
OlDosLover.
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