Recent Forum Posts
From categories:
page 1123...next »
PlayBasicSig.png

2009 PlayBASIC (game programming) Competition Starting Soon !

Surprise! - Yes, we've lined up another wacky competition for all the code crushing indie game programmers/designers out there.

What is it / When does it start ?

Visit Forums

http://www.Playbasic.com

PlayBasic V1.64K WIP thread

Work is progressing fairly well on the next major PlayBasic update. So far i'm focusing upon adding some features that are from the PlayBasic V2.00 (PBFX) design doc..

Latest additions are a bunch of new C styled math short cuts to the parser.

Read More

PlayBasic V1.64K WIP Info/Gallery by Kevin PiconeKevin Picone, 1256099865|%e %b %Y, %H:%M %Z|agohover
Re: Live Rendered Explosion
u9u9 1254233654|%e %b %Y, %H:%M %Z|agohover
in discussion PlayBasic Help / Examples » Live Rendered Explosion

it looks really retro… where did you get this? Or is it your own creation?

Re: Live Rendered Explosion by u9u9, 1254233654|%e %b %Y, %H:%M %Z|agohover
Live Rendered Explosion
hartnellhartnell 1253729618|%e %b %Y, %H:%M %Z|agohover
in discussion PlayBasic Help / Examples » Live Rendered Explosion

First Shot :

SetFPS 60

ExpCR = 0
ExpR = 50
ExpMC = $bb
ExpX = 100
ExpY = 100

Do
    ExpX = ExpX - 1
    ExpY = ExpY - 1
    If ExpR > 0 Then ExpR = ExpR - 1
    If ExpCR < ExpR Then ExpCR = ExpCR + 2
    If ExpMC > 0 Then ExpMC = ExpMC - 2
    Cls 0
        CircleC ExpX,ExpY,ExpR + 2,True,$ff0000
        CircleC ExpX,ExpY,ExpR,True,RGB($ff,ExpMC,00) 
        CircleC ExpX,ExpY,ExpCR,True, $000000
    Sync
Loop

— hartnell

Live Rendered Explosion by hartnellhartnell, 1253729618|%e %b %Y, %H:%M %Z|agohover
Re: Circle movement
u9u9 1253366580|%e %b %Y, %H:%M %Z|agohover
in discussion PlayBasic Help / Novice Questions & Answers » Circle movement

hehe jep. It is good to see you are getting your hands dirty :)

Re: Circle movement by u9u9, 1253366580|%e %b %Y, %H:%M %Z|agohover
Re: Circle movement
Emo_DinosaurEmo_Dinosaur 1253224750|%e %b %Y, %H:%M %Z|agohover
in discussion PlayBasic Help / Novice Questions & Answers » Circle movement

I figured out my mistake, needed to plug in x, y for circle instead of 100, 100

Re: Circle movement by Emo_DinosaurEmo_Dinosaur, 1253224750|%e %b %Y, %H:%M %Z|agohover
Circle movement
Emo_DinosaurEmo_Dinosaur 1253223843|%e %b %Y, %H:%M %Z|agohover
in discussion PlayBasic Help / Novice Questions & Answers » Circle movement

I'm new to programming trying to learn the basics of PB, so far I have been succesful in moving a dot with arrow keys and wasd keys but cant move a circle.

Here is the code I'm using

SetFPS 60

X=400
Y=300

    Constant vk_w = 17
   Constant vk_a = 30
   Constant vk_s = 31
   Constant vk_d = 32

Do
  If keystate(vk_w) Then y= y+ -2
  If keystate(vk_s) Then y= y+  2
  If keystate(vk_a) Then x= x+ -2
  If Keystate(vk_d) Then x= x+  2

    Cls 0
       Circle 100, 100, 16 true
    Sync
Loop

All I did was replace Dot x, y with the circle code, is there more I need to do before it will become mobile?

Circle movement by Emo_DinosaurEmo_Dinosaur, 1253223843|%e %b %Y, %H:%M %Z|agohover
Re: Quick March
FuzzyFuzzy 1252945823|%e %b %Y, %H:%M %Z|agohover
in discussion Games / Showcase » Quick March

The original plan was for there to be more balls on screen. I might make a version which does that. I also like the idea of balls bouncing around.

Re: Quick March by FuzzyFuzzy, 1252945823|%e %b %Y, %H:%M %Z|agohover
PlayBasicSig.png

PlayBasic V1.64j2 _Retail Upgrade_ is Now Available (14th, Sep, 2009)

This release updates the PlayBasic V1.63w2 -> V1.64j retail editions to the current retail release version of PlayBasic V1.64j2. However, if your edition of the PB is older than PB1.63w2, then you'll need to install that patch prior to updating the latest.

The PB1.64j package includes updates of PB Compiler, Release / Debug Runtimes, SLIBS, DOCS & IDE V1.17. The main changes for various SLIB updates and a healthy 180K reduction in the runtime sizes.

See Announcement

PlayBasic V1.64j2 _Retail Upgrade_ is Now Available by Kevin PiconeKevin Picone, 1252866498|%e %b %Y, %H:%M %Z|agohover
Re: Quick March
u9u9 1252859256|%e %b %Y, %H:%M %Z|agohover
in discussion Games / Showcase » Quick March

I like it. Not bad for a first. I was thinking instead of the balls going so much faster so quickly, you could instead have many of them and the player would have to navigate between all the balls. You could have the number of balls on screen increase slowly. Or they could bounce back and forth after they appear. They would probably have to be smaller though.

Re: Quick March by u9u9, 1252859256|%e %b %Y, %H:%M %Z|agohover

I would say sure… maybe hartnell is better at answering this question though… hartnell? :)

I read that article. Interesting reading. It is funny to see how he had to cut and cut feature as the deadline got closer.

Re: Action-Adventure question by u9u9, 1252857677|%e %b %Y, %H:%M %Z|agohover
Quick March
FuzzyFuzzy 1252836919|%e %b %Y, %H:%M %Z|agohover
in discussion Games / Showcase » Quick March

After making my first game a month a go i have just had the time to put it up (sorry about the delay!). You are the filled circle and you must avoid all the other circles using the arrow keys (it will start after three seconds). The code is quite messy at the moment, when I get the time I will tidy it up and maybe put in a start screen.

EDIT: forgot to post the code (DOH!)

setFPS 60

Global sw = getScreenWidth()
Global sh = getScreenHeight()

Global startTime      :;start time
Global time           :;elapsed time
Global scoreb         :;score from destroying ast
Global intervalH      :;max interval
Global intervalL      :;min interval
Global nextAsteroid   :;time of next asteroid
Global asteroidSpeed  :;speed of asteroids

Constant RADIUS = 15
Constant SPEED = 3
Constant POINTS_KILL = 60

Type Obj
   x
   y
EndType

Type Enemy as Obj
    dir
    alv
EndType

Dim player as Obj
Dim Asteroid(20) as Enemy

init()

Do
    updatePlayer()
   createAsteroid()
   updateAsteroid()
   collision()
    Cls 0
        score()
        drawObj()
    Sync
Loop

;work out the score and time elapsed
PSub score()
    time = (timer() - startTime) / 1000
   Print scoreb + time
   Print time
EndPsub

;init game
PSub init()
    player.x = sw / 2                              :;center player
    player.y = sh / 2

   intervalL = 2                                  :;set correct intervals for ast
   intervalH = 3

   nextAsteroid = 3                               :;set time of first asteroid to 3secs
   asteroidSpeed = 2                              :;reset ast speed
   scoreb = 0                                     :;reset score
   startTime = timer()                            :;reset start time
EndPsub

;draw objs
PSub drawObj()
    Circle player.x, player.y, RADIUS, 1            :;draw player
   For i = 0 to GetArrayElements( Asteroid(), 1 )
       If Asteroid(i).alv = true then Circle Asteroid(i).x, Asteroid(i).y, RADIUS, 0
   Next i
EndPSub

;update pos of player
PSub updatePlayer()
    If leftKey() then player.x = player.x - speed
    If rightKey() then player.x = player.x + speed
    If upKey() then player.y = player.y - speed
    If downKey() then player.y = player.y + speed
    If player.x <= 0 or player.x >= sw or player.y <= 0 or player.y >= sh then gameOver() :;check pos of player
EndPSub

;display screen when dead
Function gameOver()
    Cls 0
        centerText sw / 2, sh / 2 - 10, "You have Died"
        centerText sw / 2, sh / 2 + 10, "Press any key to continue"
        centerText sw /2, sh /2 + 30, "Your score was: " + str$(time + scoreb)
    Sync

    waitNokey
    flushKeys
    waitKey
    flushKeys

    Cls 0
        centerText sw / 2, sh / 2, "Do you want to Play Again (Y/N)"
    Sync

    Do
        If keyState(21)
         For i = 0 to getArrayElements( Asteroid(), 1 )
             If Asteroid(i).alv then Asteroid(i).alv = false
         Next i
            init()
         ExitFunction
      EndIf
        If keyState(49) then End
    Loop
EndFunction

;create asteoriods
PSub createAsteroid()
    If time >= nextAsteroid
       cell = getFreeCell( Asteroid() )

       Asteroid(cell).alv = true
       Select rndRange(1,4)                :;randomly decide dir for ast
           Case 1                 :;if right
               Asteroid(cell).y = player.y :;align ast with player
               Asteroid(cell).x = 0        :;place at side of screen
               Asteroid(cell).dir = 1 :;set var to correct dir

            Case 2                 :;if up
               Asteroid(cell).x = player.x
               Asteroid(cell).y = 0
               Asteroid(cell).dir = 2

            Case 3                 :;if left
               Asteroid(cell).y = player.y
               Asteroid(cell).x = sw
               Asteroid(cell).dir = 3

            Case 4                 :;if right
               Asteroid(cell).x = player.x
               Asteroid(cell).y = sh
               Asteroid(cell).dir = 4
       EndSelect

       nextAsteroid = rndRange(intervalL, intervalH) + time :;decide time for next ast
       Select rnd(1)                                        :;increse diffuculty
            Case 1
                intervalL = intervalL - 3
                If intervalL <= 0 then intervalL = 0

            Case 2
                intervalH = intervalH - 3
                If intervalH < intervalL then inc intervalH
       EndSelect
     EndIf
EndPSub

;update asts
PSub updateAsteroid()
    For i = 0 to getArrayElements( Asteroid(), 1 )
        If Asteroid(i).alv = true
            Select Asteroid(i).dir
                Case 2
                    Asteroid(i).y = Asteroid(i).y + asteroidSpeed:;move ast

                    If Asteroid(i).y >= sh              :;check if still on screen
                          Asteroid(i).alv = false          :;if not destroy ast
                       scoreb = scoreb + POINTS_KILL    :;increase points
                       inc asteroidSpeed                :;and speed of asteroids
                    EndIf

                Case 4
                    Asteroid(i).y = Asteroid(i).y - asteroidSpeed

                    If Asteroid(i).y <= 0
                       Asteroid(i).alv = false
                       scoreb = scoreb + POINTS_KILL
                       inc asteroidSpeed
                    EndIf

                Case 3
                    Asteroid(i).x = Asteroid(i).x - asteroidSpeed

                    If Asteroid(i).x <= 0
                       Asteroid(i).alv = false
                       scoreb = scoreb + POINTS_KILL
                       inc asteroidSpeed
                    EndIf

                Case 1
                    Asteroid(i).x = Asteroid(i).x + asteroidSpeed

                    If Asteroid(i).x >= sw
                       Asteroid(i).alv = false
                       scoreb = scoreb + POINTS_KILL
                       inc asteroidSpeed
                    EndIf

              EndSelect
          EndIf
     Next i
EndPsub

;see if a collision has occured
PSub collision()
    For i = 0 to getArrayElements( Asteroid(), 1 )
        If Asteroid(i).alv
           If CirclesIntersect(Asteroid(i).x, Asteroid(i).y, RADIUS, player.x, player.y, RADIUS) then gameOver()
        EndIf
    Next i
EndPSub
Quick March by FuzzyFuzzy, 1252836919|%e %b %Y, %H:%M %Z|agohover

Is playbasic good enough to create an Action-Adventure game like Zelda?

I'm just curious, i already know how to move the character around an all when and if i start it.
I will try to figure out how to create a map.

This website was cool, it was a game made in 40hours. http://www.gamedev.net/reference/articles/article2259.asp

Thats the kind of game i want but in more of a Zelda type look. So thats what i'm striving to make. Hope that helps you think
of what type of game i'm talking about.

Guardman 66

Action-Adventure question by Anonymous (98.17.50.24), 1252765682|%e %b %Y, %H:%M %Z|agohover
Red Waves
hartnellhartnell 1252415542|%e %b %Y, %H:%M %Z|agohover
in discussion PlayBasic Help / Examples » Red Waves

Only amateur programmers misuse collision functions in such a way it could be called abuse. :)

LoadFont "Arial", 1, 20, 0
OpenScreen 600,600,16,1

sw = GetScreenWidth()
sh = GetScreenHeight()

cr# = 5
cdist# = cr# * 2

rad# = 10

Do
radSp# = radSp# + 0.02
rad# = rad# + radSp#
If rad# > 480 Then rad# = 480 - cdist# * 10
    LockBuffer
    Cls 0
    For z = 0 to 40 Step 10
        For y = 0 to sh / cdist#
            For x = 0 to sw / cdist#
                If CirclesIntersect(x*cdist#,y*cdist#,cr#,sw/2,sh/2,rad#-cdist#*z)
                    If Not CirclesIntersect(x*cdist#,y*cdist#,cr#,sw/2,sh/2,rad#-cdist#*z-cdist#)
                    CircleC x * cdist#, y * cdist#, cr#, True, $FF0000
                    EndIf
                EndIf
            Next
        Next
    Next
    Print FPS()    
     UnLockBuffer        
    Sync
Loop

— hartnell

Red Waves by hartnellhartnell, 1252415542|%e %b %Y, %H:%M %Z|agohover
Re: Draw Text in a Box
hartnellhartnell 1252410369|%e %b %Y, %H:%M %Z|agohover
in discussion PlayBasic Help / Examples » Draw Text in a Box

This one looks a bit better. :)

LoadFont "Verdana", 1, 14, 0

SetFPS 60

textInBox$ = "Text in Box"
textW = GetTextWidth( textInBox$ )
textH = GetTextHeight( textInBox$ )
hPadd = 10
vPadd = 10
xBox = 10
yBox = 10

Do
    Cls $D3DAED

        BoxC xBox + 2,yBox + 2,xBox + textW + hPadd + 2, yBox + textH + vPadd + 2 , True, $C1CBE6
        BoxC xBox + 2,yBox + 2,xBox + textW + hPadd + 2, yBox + textH + vPadd + 2 , False, $AAAAAA  
        BoxC xBox,yBox,xBox + textW + hPadd, yBox + textH + vPadd , True, $FFFFFF
        BoxC xBox,yBox,xBox + textW + hPadd, yBox + textH + vPadd , False, $ADADAD
        Ink $000000
        Text xBox + hPadd / 2, yBox + vPadd / 2 ,textInBox$
    Sync
Loop

— hartnell

Re: Draw Text in a Box by hartnellhartnell, 1252410369|%e %b %Y, %H:%M %Z|agohover
LoadFont "Arial", 1, 16, 1

SetFPS 60

Type TObj
    x
    y
EndType

Dim gameObj As TObj

gameObj.x = GetScreenWidth() / 2
gameObj.y = GetScreenHeight() / 2

Do

    If UpKey() Then gameObj.y = gameObj.y + -2
    If DownKey() Then gameObj.y = gameObj.y + 2
    If LeftKey() Then gameObj.x = gameObj.x + -2
    If RightKey() Then gameObj.x = gameObj.x + 2

    Cls 0
        Circle gameObj.x, gameObj.y, 20, False        ; draw the player
        CenterText gameObj.x, gameObj.y - 45, "Player 1" ; then draw the caption
    Sync
Loop

— hartnell

Draw Text Above Player Position by hartnellhartnell, 1252409408|%e %b %Y, %H:%M %Z|agohover
Draw Text in a Box
hartnellhartnell 1252405519|%e %b %Y, %H:%M %Z|agohover
in discussion PlayBasic Help / Examples » Draw Text in a Box
LoadFont "Arial", 1, 20, 0

SetFPS 60

textInBox$ = "Text in Box"
textW = GetTextWidth( textInBox$ )
textH = GetTextHeight( textInBox$ )
hPadd = 10
vPadd = 10
xBox = 10
yBox = 10

Do
    Cls 0

        Box xBox,yBox,xBox + textW + hPadd, yBox + textH + vPadd , False
        Text xBox + hPadd / 2, yBox + vPadd / 2 ,textInBox$
    Sync
Loop

— hartnell

Draw Text in a Box by hartnellhartnell, 1252405519|%e %b %Y, %H:%M %Z|agohover
PlayBasic Literal Tutorial by hartnellhartnell, 1252331600|%e %b %Y, %H:%M %Z|agohover

A very long poop joke about the fundamental concepts of data in computer science and games.

— hartnell

PlayBasic Data Tutorial by hartnellhartnell, 1252119185|%e %b %Y, %H:%M %Z|agohover
Beginner Tutorial
hartnellhartnell 1252048492|%e %b %Y, %H:%M %Z|agohover
in discussion PlayBasic Help / Novice Questions & Answers » Beginner Tutorial

Watch in HD and in full screen.

Beginner Tutorial by hartnellhartnell, 1252048492|%e %b %Y, %H:%M %Z|agohover