• Welcome to Dark Bit Factory & Gravity.
 

Blitz Basic - 1st Attempt[BB2D]

Started by lilw4t3rdr0p, October 27, 2006

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

lilw4t3rdr0p

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:


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.


Clyde

#1
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.


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
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

lilw4t3rdr0p

Thank Clyde.

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

Rbz

Nice one lilw4t3rdr0p  :) 

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

lilw4t3rdr0p

I haven't learned that yet. I think that may be coming next.

Thank you.

CoDeMaN

As he is doing RND dont he need the brackets ?

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

Shockwave

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


Shockwave

Have to get you doing starfields and scrollers next.
Shockwave ^ Codigos
Challenge Trophies Won:

lilw4t3rdr0p


Clyde

#10
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.


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



;
; 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.
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.


Challenge Trophies Won:

lilw4t3rdr0p

Thanks Clyde.

I will try that!

Clyde

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:

ninogenio

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

Thanks! That is my plan! :D

lilw4t3rdr0p

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?

Shockwave

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

#17
Thanks!


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


Shockwave


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

I see where I was wrong and I am a dork! Thank you!