Blitz Plus

Whether you're a newbie or an experienced programmer, any questions, help, or just talk of any language will be welcomed here.

Moderator: Coders of Rage

Which is better, Blitz (Not Blitz Plus FOOL!) or Quick Basic?

Blitz
4
67%
Quick Basic
1
17%
Hamm Sammich (For all of you know-nothings!)
1
17%
 
Total votes: 6

Guest

Blitz Plus

Post by Guest »

Because C and C++ are too advanced for me, and Quick Basic is too poserish, I have made up my mind. I am going to master Blitz Plus. I am TOTALLY new to it, and have nothing more than its envirnment. If ANYONE can help, please post here. My first question: Does anyone know of any site or anything that can help get me started? I know ABSOLUTLY nothing. Please, direct me with a link!
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Post by Falco Girgis »

There is no good site. The help section of the Blitz environment is great. That is how JS Lemming and I learned. JS Lemming was infinately better at blitz than I before we both quit and learned C languages.
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post by JS Lemming »

Well actually, I had learned C++ before I even knew of blitz.... That is probably why I hate Blitz so much now.

Catution!!!! I've done some experiments and have found that Blitz DOES leak memory. If you call up you system's resource watcher thing and run a blitz program several times, your memory will drop and won't come back till ya restart... Soooo anoying! :evil:
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
User avatar
Falco Girgis
Elysian Shadows Team
Elysian Shadows Team
Posts: 10294
Joined: Thu May 20, 2004 2:04 pm
Current Project: Elysian Shadows
Favorite Gaming Platforms: Dreamcast, SNES, NES
Programming Language of Choice: C/++
Location: Studio Vorbis, AL
Contact:

Post by Falco Girgis »

I think Blitz will do nicely.

I could see Arce learning C++ and declaring only INLINE functions. Then he'll recurserate them like a billion times and wonder why his computer crashes! :twisted:
Guest

Post by Guest »

I never understood the whole thing where keys are numbers when you use them in programs. So I tried to make a program that tells you what number a key is when you hit it. But for some reason, IT DOESN'T WORK! Here it is.

Code: Select all

Print "Please press any key, and I'll tell you the number of it!"
While Not value
value=getkey()
Wend
Print "The number of the key you hit is:"+value
When I run it, it just says: "Please press any key, and I'll tell you the number of it!" and when I hit a key, it does nothing. FIX IT JS LEMMING!


Because that was made on MY computer, and I am on a differnt one, I cannot copy and paste my code. I am too lazy to put labels, SO FIGURE IT OUT!

Which command would you people prefer, the repeat/forever or while/wend? I know they should be used in differnt cases, but there are some times when either would do. In one of those cases that you could do either, which would you use?
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post by JS Lemming »

First off, the people who made Blitz should be shot. There console box barely ever works right. Secondly, this is not a good method of finding key codes. Try looking in the Command Reference thing and click "ScanCodes - Interactive". This is how I do it. But just in case, this is my cheap version, try it out. ESC quits the pilgrim.

Code: Select all

;Set screen resolution to 800x600
Graphics 800,600

;It's a good idea to globalize things
Global KeyCode = 0

;While ESC Key not pressed
While Not KeyDown(1)

	;Store key's scan code in variable
	KeyCode = GetKey()

	;If a key is being pushed
	If KeyCode > 0
	
		;Clear the screen
		Cls
		
		;Output the text and key code
		Text 5,5,"The Scan Code for this key is: "+KeyCode
		
		;Flip the screen into view
		Flip
		
	EndIf

Wend
Hope that helps. :spin:
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
Guest

Post by Guest »

Yes, that does work, thank you. But what was wrong with mine? Did it HAVE to have the graphics? Could you please fix MINE?
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post by JS Lemming »

Your code is flawless. Blitz is the one to blame. Be carefull when using that nasty blitz console box, it's toooo glitchy.
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
Guest

Post by Guest »

Der.....Does anyone here have a SHITLOAD of time? if you do, please, please correct this un-labled code! When I try to load my game, it mixes up all the variables, and prints my name as my defence, and so on. Please fix this! Oh, and it almost seems as if the random numbers aren't random, did I screw something up here, too?

Here's the code:

Code: Select all

.openingload
answernumone$=Input$("Would you like to load a currently saved file, or make a new one?(load/new)")
 
 If answernumone$="load" Then
Goto Loadname

ElseIf answernumone="new" Then 
Goto information 

Else 
Print "Invalid command. Either type 'load' or 'New'. No capitals, or this message will be triggered once more."
Delay 2000
Gosub openingload
End If 

.information
 name$=Input$ ("What is your name?")
 age=Input ("Well, " + name$ + ", before we get started, I must know your age in this game. How old are you?")

. agechecker
If age < 16 Then
Print "Thats too young, dumbass! How do you think you can run around and kill people when you're only" + age + "!?"
age=Input$("Enter a realistic age...")
Gosub agechecker

ElseIf age > 69 
age=Input$("You retard! If you even walk at age " + age + ", you'd probably break your back and die! Be realistic! Enter another age...")
Gosub agechecker

Else
EndIf 

.correction 
 replyone$=Input$ ("So you are " + name$ + ", age " + age + ", correct? (yes/no)")

If replyone$="yes" Then
  Print "Well, we've covered that..."
Goto continue


ElseIf replyone="no" Then
.correctiontwo
replytwo$=Input$ ("Would you like to change your name and age? (yes/no)") 
  Goto two

Else 
 Print "Invalid answer. Either type yes or no. No capitals please."
  Delay 2000
  Gosub correction
EndIf 

.two
If replytwo$="yes" Then 
 Gosub information

ElseIf replytwo$="no" Then
 Goto continue

Else 
 Print "Invalid answer. Either type yes or no. No capitals please."
  Delay 2000
  Goto correctiontwo

End If



 


Clearscreen$= "																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																																		"
. Loadname
Print clearscreen$
Print "Loading....."
filein = ReadFile("gameinfo.tcr") 
name$ = ReadString ( filein )
gender$ = ReadString ( filein )
age = ReadString ( filein )
strength = ReadString ( filein )
speed = ReadString ( filein )
defence = ReadString ( filein )
CloseFile( filein )
Delay 3000
.currentinfoquestion
numthree$=Input$("Your Current name is " + name$ + " of whom was a " + gender$ + " with the current age of " + age + ". His strength was " + strength + ", his speed was " + speed + " and his defence was " + defence + ". Would you like To continue with this character information, or reset it? (New/continue)")
If numthree$="new" Then
Gosub information 
ElseIf numthree$="continue" Then 
Goto continue
Else 
Print "Either type 'new' or 'continue' without capitals."
Delay 3000
Gosub currentinfoquestion
EndIf


.continue 
Print Clearscreen
Print "Okay, it's time to get our other status."
. gender
gender$=Input$("Are you a male, or female? (male/female)")
If gender$="male" Then
questionaboutgender$=Input$("So you have a penis? (yes/no)")
ElseIf gender$="female" Then
questionaboutgender$=Input$("So....You're missing your male equiptment? (yes/no)")
Else
Print
Print "Either you have a dick, or you don't! So type 'male' or 'female' without capitals!"
Delay 5000
Gosub gender
End If
If questionaboutgender$="yes" Then
Goto aftergender
ElseIf questionaboutgender$="no" Then
Print clearscreen$
Gosub gender
Else 
Print "Either you have your equiptment, or you don't. So type 'yes' or 'no' without capitals!"
Delay 5000
Print Clearscreen
Gosub gender
EndIf

I#=1
 
. aftergender
I#=I#+1 
Strength= Rnd(1,25)
Speed= Rnd(1,25)
Defence= Rnd(1,25)
. anotherquestion
choicecharactercapabilities$=Input$("On a random dice roll, we got " + Strength + " for your charector's strength, " + Speed + " for its speed, and " + Defence + " for its defence. Would you like to re-roll, or keep this? (re-roll/keep)")
If choicecharactercapabilities$="re-roll" Then 
Print
If I# = 3 Then 
Goto keepstats
Else 
Gosub aftergender
End If 
ElseIf choicecharactercapabilities$="keep" Then
Goto secondsave
Else 
Print clearscreen$
Print "Either type 're-roll' or 'keep' without capitals!"
Delay 4000
Gosub anotherquestion
EndIf


. keepstats

Print "On a random dice roll, we got " + Strength + " for your charector's strength, " + Speed + " for its speed, and " + Defence + " for its defence."
Print "Because this was the third roll, you cannot roll again."
Delay 10000
Print clearscreen
Print "Auto-saving stats"
. secondsave
fileout = WriteFile("gameinfo.tcr") 
WriteString( fileout, name$ ) 
WriteString( fileout, gender$ ) 
WriteString( fileout, age ) 
WriteString( fileout, strength ) 
WriteString( fileout, speed ) 
WriteString( fileout, defence ) 
CloseFile( fileout )
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Print "Save Complete."
Print "This program has ended!"
Delay 5000
End
If you copy this into the envirnment, and on the left side click on the label loadname and secondsave, then you may find the problem easier to identify.

Oh, and if you make fun of my way of clearing the screen, I will shoot you. It seems cls is only on graphics mode, and I don't want to type more than "Print clearscreen$" to clear it. If you find the problem please, tell me. And, how do I change my program's icon? I hear it's hard, but I dunno.
Guest

Post by Guest »

Okay, just forget that I even posted that question. There is in fact NO problem with my program, I was just being a dumbass. I didn't know that when I told it to write to gameinfo.tcr, I already had that file created from an earlier version of my program, and the writestring command doesn't overwrite an already made file. So once I deleted it, It worked!
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post by JS Lemming »

There is no such thing as random numbers (yet), but to make it seem like there is, try puting this line of code near the top of your program:

Code: Select all

;This seeds the random generator
SeedRnd(MilliSecs())
And if I where you, I would start comenting my code. You will hate yourself later if you don't get into the habit of doing so.
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
Guest

Post by Guest »

Thanks for

Code: Select all

SeedRnd(MilliSecs())
thing, I'll try it out. But right now, I have a problem....I just added a bunch of crap to my programs (I SWEAR TO GOD I'LL LABEL IT LATER)

Code: Select all

. ministory
Print Clearscreen$
Print "So the adventure begins!"
Delay 3000
Print clearscreen$
Print "As you awake, you hear the booming chants of the villagers within your hometown. Quickly you hop out of the hay loft, and follow the noise to the townhall."
Print "Within the town hall, you see hundreds of villagers gathered around the high platform of the village head."
Print "It is then that you see the king rise from his seat, with a look of anger upon his face. Then he speaks: Fellow town people! Villagers! Lastnight was a heartbreaking one, that left me and my guards in shock! For it was this time that my whife was abducted! May any man be brave enough to rescue her from her captors, they shall have my blessings, and an award of 1000 Goldpieces!"
Print 
. asthekingspeaksthesewords
ministorychoice$=Input$("As the village head speaks these words, the crowd backs away. Not ONE person dares to rescue the village head's wife! Do you step forward? (yes/no)")
If ministorychoice$="yes" Then
Print 
Goto cowardice
ElseIf ministorychoice="no" Then
Print
Goto DodgeDaAx
Else 
Print
Print "Invalid command! Enter 'yes' or 'no' without capitals!"
Delay 3000
Print
Gosub asthekingspeaksthesewords
EndIf
. cowardice
Print "The village head's eyes the crowd with almost what seems to be pity. You even hear him murmer, 'poor bastards..'."
Print "Tears fill his eyes as he sees only one volunteer: YOU"
Print "The kings speaks once more: My fellow villagers, surly one man cannot take out an army of six goblins! Will no person summon the curage to fight alongside this brave man?!"
Print
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Print
Print "Once more, no man volunteers but you."
Delay 2000
Print clearscreen$
Goto savewife

. DodgeDaAx
FlushKeys
Print "As you go home from the town hall, your fater, the exacutionier, rises with a smile to great you."
Print
Delay 5000
Print "HE PULLS OUT A BLOODY AX!"
Print
current=MilliSecs() 
Print "HIT A FIVE TIMES!" 
While MilliSecs() < current+2000 
Wend 
A=KeyHit(30) 
If A > 5 Then
Goto alive
Else

Print "Because you did not hit 'A', you didn't dodge, so this happens:"
Delay 500
Print "With a flex of his powerful arms, your head flips to the ground."
Print "The last words you hear as the blood drains from your braim is: COWARD!"
Print
Goto dead
End If

. dead
status$="DEAD"
strength=0
speed=0
defence=0
health=0
Print "Auto Saving....."
fileout = WriteFile("gameinfo.tcr") 
WriteString( fileout, name$ ) 
WriteString( fileout, gender$ ) 
WriteString( fileout, age ) 
WriteString( fileout, strength ) 
WriteString( fileout, speed ) 
WriteString( fileout, defence ) 	
WriteString( fileout, health ) 
WriteString( fileout, status$ ) 
CloseFile( fileout )
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Write "."
Delay 500
Write " . "
Print "Save Complete."
Delay 5000
End

. alive
Print "You dodged his ax! You turn and leap out the door..."
Delay 1000
Print "Just to be greeted by your mother, with an arrow to the heart!"
Goto dead
. savewife 
Print "This is all I have so far...."
Delay 5000
The thing that doesn't work here is :

Code: Select all

Delay 5000
Print "HE PULLS OUT A BLOODY AX!"
Print
current=MilliSecs() 
Print "HIT A FIVE TIMES!" 
While MilliSecs() < current+2000 
Wend 
A=KeyHit(30) 
If A > 5 Then
Goto alive
Else
When I hit "A" WAY more than 5 times, or just 5, it still brings me to the dead part of the program. I cannot find were I screwed up this time, could you help?
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post by JS Lemming »

Alright, the blitz console box, from my experience, has many limitations. Including the inability to use cool functions like: KeyHit, KeyDown, getkey and a tun more. EVEN Though the stupid people used them in the command reference like a console. I don't think they even tested thier samples!!! So, by what I see, I think you want to combine action with a regular text based game, if so, you have to forget about blitz's console box. C++'s console box could, but thats more then you need. I'm going to suggest diving into Blitz's real goodness, the graphics system.

P.S. I'm thinking that maybe I could make an engine in Blitz that acts like the console box, but has use of all functions. That way, you could still make your game with relative ease.

P.S.P.S Try your hand at writing functions instead of the highly limited goto command. If you need help on that I will assist.
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
User avatar
JS Lemming
Game Developer
Game Developer
Posts: 2383
Joined: Fri May 21, 2004 4:09 pm
Location: C:\CON\CON

Post by JS Lemming »

IMPORTANT!

Would you like your text based games to be in windowed form, or fullscreen???
Small girl at the harbor wrote:Look Brandon, that crab's got ham!
Guest

Post by Guest »

I'm going to suggest diving into Blitz's real goodness, the graphics system.
I decided to just do text until I have successfully made a program and understand more about blitz. But I guess that went pretty crappy :( I will attempt graphics, but I am not understanding much.

For my first program dealing with graphics, I want to make a two player game (one person uses UP, DOWN, LEFT, RIGHT, and the other A, S, W,Z) where you're both differnt sprites, you can both move freely around the 640 x 640 screen, and shoot a bullet. If your hit by the others bullet, you die. To do this, do I have to use

Code: Select all

Type
for the bullets so I can shoot multiple ones, and if so, what is a type? I am not understanding that one bit
Would you like your text based games to be in windowed form, or fullscreen???
I'd probably want it fullscreen....
P.S.P.S Try your hand at writing functions instead of the highly limited goto command. If you need help on that I will assist.
What is the difference between the two? How aree 'functions' less limited that goto?

If I want my program to save, and I don't want to have to type all the crap to open the .tcr, write to it, and so on, is there a way I can use the goto command or something else to make it save, THEN return to where the program was BEFORE it saved?

I know I ask you a hell of a lot of things, thanks for replying! :D

P.S. Uhh...I labeled my program, but it looks WAY worse, and just confuses me.... It looks like no more than a bunch of differnt colored bullshit. I don't think you EVER want to see one of my programs with labels....
Post Reply