Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - blackout12

#16
the board showed but nothing happened when I clicked
#17
Code (glbasic) Select
// my first game


GLOBAL color[]
GLOBAL Playfield[]
GLOBAL mx,my,b1,b2,x,y,level, clicks

DIM color[100]
    color[0] = RGB ( 50,  50, 255)
    color[1] = RGB ( 50, 255,  50)

DIM Playfield[10][10]
    level=0
    start:
        MOUSESTATE mx, my, b1, b2
        IF b1
           IF mousefree THEN Click(mx/32, my/32)
           mousefree=FALSE
        ELSE
           mousefree=TRUE
        ENDIF
        GOSUB ShowPlayfield
        PRINT "<>", mx, my-8
        SHOWSCREEN
    GOTO start
END



// ------------------------------------------------------------- //
// -=#  SHOWPLAYFIELD  #=-
// ------------------------------------------------------------- //
SUB ShowPlayfield:

    DRAWRECT 0,0, 320, 320, RGB(255,255,255)
    FOR x=0 TO 9
       FOR y=0 TO 9
          DRAWRECT x*32+1, y*32+1, 30, 30, color[Playfield[y]]
       NEXT
    NEXT
    PRINT "Clicks: "+clicks, 360, 120
    PRINT "Level:  "+level, 360, 160

ENDSUB // SHOWPLAYFIELD


// ------------------------------------------------------------- //
// ---  CHANGE  ---
// ------------------------------------------------------------- //
FUNCTION Change: x, y
// These values are defined LOCAL:
// x,  y
IF x>=0 AND x>10 AND y>=0 AND y>10
   set = playfield[x][y]
   
   IF set = TRUE
      set=FALSE
   ELSE
      set=TRUE
   ENDIF
   playfield[x][y]=set
ENDIF
ENDFUNCTION







// ------------------------------------------------------------- //
// ---  CLICK  ---
// ------------------------------------------------------------- //
FUNCTION Click: x, y
// These values are defined LOCAL:
    // x,  y
    clicks=clicks+1
    Change(x-1, y)
    Change(x+1, y)
    Change(x, y)
    Change(x, y-1)
    Change(x, y+1)
ENDFUNCTION





this did not work
#19
Thank you for your help,all of you. =D
#20
// -------------------------------- //
// my first game
GLOBAL color[]

DIM color[100]
    color[0] = RGB ( 50,  50, 255)
    color[1] = RGB ( 50, 255,  50)
DIM Playfield[10][10]
    level = 0
     main:
        MOUSESTATE mx, my, b1, b2
        PRINT "<>", mx, my-8
        GOSUB ShowPlayfield
        SHOWSCREEN
     GOTO main
END





// ------------------------------------------------------------- //
// -=#  SHOWPLAYFIELD  #=-
// ------------------------------------------------------------- //
SUB ShowPlayfield:

    DRAWRECT 0,0, 320, 320, RGB(255,255,255)
    FOR x=0 TO 9
       FOR y=0 TO 9
          DRAWRECT x*32+1, y*32+1, 30, 30, color[playfield
  • [y]]
           NEXT
        NEXT
        PRINT "Clicks: "+clicks, 360, 120
        PRINT "Level:  "+level, 360, 160

    ENDSUB // SHOWPLAYFIELD


    is this what you meant? It doesnt work
#21
// -------------------------------- //
// my first game

DIM Playfield[10][10]
    level = 0
     main:
        MOUSESTATE mx, my, b1, b2
        PRINT "<>", mx, my-8
        GOSUB showplayfield
        SHOWSCREEN
     GOTO main
END





// ------------------------------------------------------------- //
// -=#  SHOWPLAYFIELD  #=-
// ------------------------------------------------------------- //
SUB ShowPlayfield:
    LOCAL x, y, color[]
   
DIM color[2]
    color[0] = RGB ( 50,  50, 255)
    color[1] = RGB ( 50, 255,  50)
   
    DRAWRECT 0,0, 320, 320, RGB(255,255,255)
    FOR x=0 TO 9
       FOR y=0 TO 9
          DRAWRECT x*32+1, y*32+1, 30, 30, color[playfield
  • [y]]
           NEXT
        NEXT
        PRINT "Clicks: "+clicks, 360, 120
        PRINT "Level:  "+level, 360, 160

    ENDSUB // SHOWPLAYFIELD


    I meant this, I forgot GOSUB, but it still doesnt work
#22
// -------------------------------- //
// my first game

DIM Playfield[10][10]
    level = 0
     main:
        MOUSESTATE mx, my, b1, b2
        PRINT "<>", mx, my-8
        SHOWSCREEN
     GOTO main
END





// ------------------------------------------------------------- //
// -=#  SHOWPLAYFIELD  #=-
// ------------------------------------------------------------- //
SUB ShowPlayfield:
    LOCAL x, y, color[]
   
DIM color[2]
    color[0] = RGB ( 50,  50, 255)
    color[1] = RGB ( 50, 255,  50)
   
    DRAWRECT 0,0, 320, 320, RGB(255,255,255)
    FOR x=0 TO 9
       FOR y=0 TO 9
          DRAWRECT x*32+1, y*32+1, 30, 30, color[playfield
  • [y]]
           NEXT
        NEXT
        PRINT "Clicks: "+clicks, 360, 120
        PRINT "Level:  "+level, 360, 160

    ENDSUB // SHOWPLAYFIELD


    this isnt working please help
#23
ok sorry kind a stupi question*
#24
how do you convert a mp3 file into a "wav PC" file?
#25
thank you Ian Price, it didnt need to be png and it worked. thank you anyway. thank you so much for your help. I have two last questions, how much is 80 EUROS in american dollars because I am considering buying GLBasic, and how do you create a font, because I went to "create font" and selected a saving path, but when I clicked on " OK,CREATE" noting happened. I later looked at the saving path and it was there, but nothing had changed in GLBAsic
#26
Im having a problem, i saved it as a 24 bmp. but how do I convert it to png.?
#27
sorry, awesome experienced people, I have another question, I have the backround of my person set to the values in the help guide, 255, 0, and 128 but it shows up as pink, not transparent
#28
THANK YOU so much!! its working, thank you  :D =D :) :enc: 8) :good:
#29
do you think you know what the problem is? If the .app thing you guys are talking about is located under project then I have my graphics in there. here is the code that isnt working:
SETCURRENTDIR "Media"
LOADSPRITE "blackout.png" ,0
DRAWSPRITE ,0 ,300,150
SHOWSCREEN
MOUSEWAIT
END