Author Topic: Blitz Basic - 1st Attempt[BB2D]  (Read 12952 times)

0 Members and 1 Guest are viewing this topic.

lilw4t3rdr0p

  • Guest
Blitz Basic - 1st Attempt[BB2D]
« on: October 27, 2006 »
Okay, Here is my very first attemp at Blitz Basic.

Does the code look right? Is there anything missing? Anything I don't need?

I tried to have some shapes, movement, color, text, random, and I tried to work with spacing (getting things visually pleasing).

This is only from my third lesson, so be kind!

Any feedback would be great!

Thanks.

Here you go:

Code: [Select]
Graphics 640,480,32,3
SetBuffer BackBuffer()

While Not KeyDown(1)
Color 222, 0, 0
Text (242),(228),"My Love!"
Color 0, 200, 15
Text (64), (194), "You Make My Dreams Come True."
Color 75, 75, 230
Text (262), (262), "With Love, Tracy!"
Color 178, 178, 10
Text Rnd (180), (100), "Whoo!"
VWait
Color 178, 178, 10
Text Rnd (460), (362), "Yay!"
VWait
Color 225, 25, 225
Rect 95, 42, 20, 20
Color 225, 25, 255
Oval 237, 420, 20, 20
Flip
Cls
Wend

Edit - [ Code ] tags added.

« Last Edit: July 21, 2007 by Shockwave »

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Blitz Basic - 1st Attempt
« Reply #1 on: October 27, 2006 »
Not bad at all, and welldone. The only thing I'd mention, is that it's not neccassary to have brackets around the positons of the text.

You can also substitute the 32 for a 0 if you wanted to, so the the program automatically finds a colour bit depth. But I generally use 32bit as colours can look naff.

Btw, Use 2 for Windowed mode, rather then 3 as that is for a custom scaled window size that isnt generally recognized. For example
Graphics 128,128,32,3.

Code: [Select]
Graphics 640,480,32,2
SetBuffer BackBuffer()

While Not KeyDown(1)

Color 222, 0, 0
Text 242,228,"My Love!"

Color 0, 200, 15
Text 64, 194, "You Make My Dreams Come True."

Color 75, 75, 230
Text 262, 262, "With Love, Tracy!"

Color 178, 178, 10
Text Rnd (180), 100, "Whoo!"
VWait

Color 178, 178, 10
Text Rnd (460), 362, "Yay!"
VWait

Color 225, 25, 225
Rect 95, 42, 20, 20

Color 225, 25, 255
Oval 237, 420, 20, 20

Flip
Cls

Wend
« Last Edit: October 27, 2006 by Clyde »
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

lilw4t3rdr0p

  • Guest
Re: Blitz Basic - 1st Attempt
« Reply #2 on: October 27, 2006 »
Thank Clyde.

Is the code tag something I can add and if so... how do I do it?

Offline Rbz

  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 2757
  • Karma: 493
    • View Profile
    • https://www.rbraz.com/
Re: Blitz Basic - 1st Attempt
« Reply #3 on: October 28, 2006 »
Nice one lilw4t3rdr0p  :) 

How about add a text scroller  ?   8)
Challenge Trophies Won:

lilw4t3rdr0p

  • Guest
Re: Blitz Basic - 1st Attempt
« Reply #4 on: October 28, 2006 »
I haven't learned that yet. I think that may be coming next.

Thank you.

Offline CoDeMaN

  • Atari ST
  • ***
  • Posts: 127
  • Karma: 38
    • View Profile
Re: Blitz Basic - 1st Attempt
« Reply #5 on: October 28, 2006 »
As he is doing RND dont he need the brackets ?

Text Rnd (180), (100), "Whoo!"

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17427
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: Blitz Basic - 1st Attempt
« Reply #6 on: October 28, 2006 »
Yep Codeman, you're right.
Blame me for it, I taught her to do it that way :)

Thanks for the mushy message Tracy, it's a great start. Well done!
Shockwave ^ Codigos
Challenge Trophies Won:

lilw4t3rdr0p

  • Guest
Re: Blitz Basic - 1st Attempt
« Reply #7 on: October 28, 2006 »
Thanks!

I try!

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17427
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: Blitz Basic - 1st Attempt
« Reply #8 on: October 28, 2006 »
Have to get you doing starfields and scrollers next.
Shockwave ^ Codigos
Challenge Trophies Won:

lilw4t3rdr0p

  • Guest
Re: Blitz Basic - 1st Attempt
« Reply #9 on: October 28, 2006 »
Sounds good to me!

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Blitz Basic - 1st Attempt
« Reply #10 on: October 28, 2006 »
Code tags are part of the ways you can format your topics / replies; you'll see a list of these by not doing a Quick Reply.

You do need the brackets for using Rand / Rnd, that is correct but as the y position isn't random then there is no need to include them.

Code: [Select]
;
; As In Original Program. Notice Y is not a random position.
;
Text Rnd (180), (100), "Whoo!"

Code: [Select]
;
; Altered.
;
Text Rnd (180), 100, "Whoo!"

A Few Tips:
Both the following commands are used for producing a Random number, but with slight differences.

Rnd is for floating point variables # ( numbers with decimal points )
Rand is for integers % ( for example 2, 50, 120 etc - whole numbers )

Also you can have 2 ranges in these commands for example Rand (120,240) which will give a random number between 120 and 240.
« Last Edit: October 28, 2006 by Clyde »
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

lilw4t3rdr0p

  • Guest
Re: Blitz Basic - 1st Attempt
« Reply #11 on: October 28, 2006 »
Thanks Clyde.

I will try that!

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Blitz Basic - 1st Attempt
« Reply #12 on: October 28, 2006 »
No worries LDW :) glad to help where I can.

All the best,
Clyde.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline ninogenio

  • Pentium
  • *****
  • Posts: 1668
  • Karma: 133
    • View Profile
Re: Blitz Basic - 1st Attempt
« Reply #13 on: October 28, 2006 »
nice first progy lilw4t3rdr0p,

im sure youll get on full terms with blitz in no time then you can show us how its done ;)
Challenge Trophies Won:

lilw4t3rdr0p

  • Guest
Re: Blitz Basic - 1st Attempt
« Reply #14 on: October 30, 2006 »
Thanks! That is my plan! :D

lilw4t3rdr0p

  • Guest
Re: Blitz Basic - 1st Attempt
« Reply #15 on: October 30, 2006 »
Okay, So here is my next step. (intergers and Varibles next)

But it won't run. It says Font not found. So my question is how do I know what fonts Blitz will and will not run?

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17427
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: Blitz Basic - 1st Attempt
« Reply #16 on: October 30, 2006 »
Blitz will be able to use any fonts you have installed on your computer..
Why not post the offending bit of code and we'll sort the bug out for you.
Shockwave ^ Codigos
Challenge Trophies Won:

lilw4t3rdr0p

  • Guest
Re: Blitz Basic - 1st Attempt
« Reply #17 on: October 30, 2006 »
Thanks!

Code: [Select]
Graphics 640,480,32,2
SetBuffer BackBuffer()

While Not KeyDown(1)
LF = LoadFont ("Veranda", 20, True, False, False)
LF = LoadFont ("Times New Roman", 24, False, False, True)
LF = LoadFont ("Arial", 16, True, False, True)
SETFONT LF1
Color 222, 0, 0
Text 242, 228,"I love You!"
SETFONT LF2
Color 0, 200, 15
Text 64, 194, "You Make My Dreams Come True."
SETFONT LF3
Color 75, 75, 230
Text 262, 262, "Thank You!"
Color 178, 178, 10
Text Rnd (180), 100, "DBF/GVY!"
VWait
Color 178, 178, 10
Text Rnd (460), (362), "WHOO!"
VWait
Color 225, 25, 225
Rect 95, 42, 20, 20
Color 225, 25, 255
Oval 237, 420, 20, 20
Flip
Cls
Wend
« Last Edit: October 30, 2006 by lilw4t3rdr0p »

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17427
  • Karma: 499
  • evil/good
    • View Profile
    • My Homepage
Re: Blitz Basic - 1st Attempt
« Reply #18 on: October 30, 2006 »
Code: [Select]
Graphics 640,480,32,2
SetBuffer BackBuffer()

While Not KeyDown(1)
LF1 = LoadFont ("Verdana", 20, True, False, False)
LF2 = LoadFont ("Times New Roman", 24, False, False, True)
LF3 = LoadFont ("Arial", 16, True, False, True)
SetFont LF1
Color 222, 0, 0
Text 242, 228,"I love You!"
SetFont LF2
Color 0, 200, 15
Text 64, 194, "You Make My Dreams Come True."
SetFont LF3
Color 75, 75, 230
Text 262, 262, "Thank You!"
Color 178, 178, 10
Text Rnd (180), 100, "DBF/GVY!"
VWait
Color 178, 178, 10
Text Rnd (460), (362), "WHOO!"
VWait
Color 225, 25, 225
Rect 95, 42, 20, 20
Color 225, 25, 255
Oval 237, 420, 20, 20
Flip
Cls
Wend

Fixed :)
Your variables were wrong and you'd tried to load a font called Veranda!
Shockwave ^ Codigos
Challenge Trophies Won:

lilw4t3rdr0p

  • Guest
Re: Blitz Basic - 1st Attempt
« Reply #19 on: October 30, 2006 »
I see where I was wrong and I am a dork! Thank you!