Page 1 of 1

Darth Rage's beta video game!! :D

PostPosted:Wed Jan 09, 2013 2:19 am
by Darth Rage
THE BUG HAS BEEN FIXED! Thanks to;

-[KR]- Jawfin

-[KR]- Madhatter

-[KR]-Necros

Thx again my friendz. now i just need to figure a way for level 2, then the beta pre releases will be almost complete, turning the game complete, witch makes me able to add tweaks and add more things. to it. so thx for ur time.

Link will be RE uploaded when i find a way to add level 2 and so forth.

LINK

http://www.gamefront.com/files/22831395 ... Failed.zip

PostPosted:Wed Jan 09, 2013 2:22 am
by jawfin
The file you are looking for seems to be unavailable at the moment. Please come back later.
If you have a bug in a batch file I can fix it.

PostPosted:Wed Jan 09, 2013 2:32 am
by Darth Rage
Jawfin wrote:
The file you are looking for seems to be unavailable at the moment. Please come back later.
If you have a bug in a batch file I can fix it.
Ok GREAT! :) if you download the zip file, there will be a txt file. read it, then at the end it will say something about me wanting someone to find a bug in it somewhere. then below that shows my coding. go ahead and give it a try to look if you want :)

PostPosted:Thu Jan 10, 2013 12:16 am
by Zabuza
>< You have a lot of cleaning up to do in your code..

For now I'll just show your bug/ it's fix.
Code: Select all
:game
cls
echo Now tell me, whats your name?
set /p name=
echo Well hello %name%!
echo Do you want to start the quiz? (y/n)
set /p start=

if %start% == y goto lvl1
if %start% == Y goto lvl1
if %start% == n goto menu
if %start% == N goto menu
goto game // was goto startgame
I don't know what these blocks are called in DOS/Batch, but I'm assuming they're similar to methods in Java. Your last line was originally "goto startgame". Problem was you named your "method" game.
Code: Select all
:lvl1
cls
color 0a
echo Hello! Please answer the following. (ANSWERS ARE NOT SENT TO CREATOR!)
echo True or false. In minecraft, if your X/Z cordinants are divisible by 16, you are standing on the boundry of a chunk.
echo A. True
echo B. False
echo C. I don't know!
set /p lvl1= // You forgot to declare your var

if %lvl1% == a goto cr1
if %lvl1% == B goto wr1
if %lvl1% == C goto cr1
goto lvl1
Here in the lvl1 method/function/thing, you forgot to declare your variable "lvl1" (you had used "!"). Also, please note that it's bad programming practice to use non-letter/digit characters to use as variable names (Java doesn't even allow it)!

Other suggestions:

: Look into ignore case sensitivity to reduce a few lines of code.
: When picking your variable and method/function names, pick something that makes sense. Game, info, lvl1, and menu are good but cr1 and wr1 make no sense. It helps the person reading your code =) .

// Jaw probs knows a lot more about this than I do ><

PostPosted:Thu Jan 10, 2013 2:10 am
by Necros
Zab seems to have covered most of what I could find (as he said, Jaw most likely knows more than us as I would consider myself an intermediate at best.) However, I'm not sure, I've never wrote anything with batch files before but there should be a way to handle errors. I know, it's beta so I mean this kind of bare bones but there should be some error handling in here.
Code: Select all
echo Do you want to start the quiz? (y/n)
set /p start=

if %start% == y goto lvl1
if %start% == Y goto lvl1
if %start% == n goto menu
if %start% == N goto menu
goto startgame
Biggest thing to me is in that code there. Someone with fat fingers like me would go to hit y, and end up hitting a t. As is now, the program just crashes with no rhyme or reason. Instead, find a way to have it exit gracefully, or reroute the user back to a safe place with an error message telling them what happened. Otherwise, I think Zabby covered most of it before me (Go Zabby :> )

Edit: Also,
Code: Select all
READ BEFORE PLAYING!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!.txt
Holy exclamation points Batman D:

PostPosted:Thu Jan 10, 2013 2:41 am
by Zabuza
Ignore case sensitivity =). For Batch it would be:
Code: Select all
if /i %start% == y goto lvl1 
Now you can do capital or little y to continue to level 1. Here is a download link. Added in some comments, fixes etc. Should be running great now (until you reach level 2 :P).

I love necy poo <3

PostPosted:Thu Jan 10, 2013 2:59 am
by Darth Rage
OK thx it worked out great. NOW all i need, is how to make a level 2 or more. should i just repeat the process like i did with level one just make it 2 instead of 1? i tried that and i crashed. if i have to do that then i must have typed wrong (i type extremely fast and dont always take my time.. i type like notch from Mojang LOL) ok you can use the coding in my download since you already have it (if u saved it :O ) but if you do know how to make a level 2. now if no one does i will have to ask the uploader for the tutorial on youtube. thx

PostPosted:Thu Jan 10, 2013 3:29 am
by Zabuza
Necros wrote:Biggest thing to me is in that code there. Someone with fat fingers like me would go to hit y, and end up hitting a t.
Remedied that with:
Code: Select all
 if /i %start% == y (goto lvl1) else (goto game)
This way it'll call itself again if its something besides y or n. Also you can remove the :game block (the one in my download at the bottom at this post) because it's redundant to ask them to play if they already selected start :P. I just kept it as-is for now.

As for your level 2 not working it is because of this line:
Code: Select all
set/p Ha=
You declared your variable with a capital H, but you used a lowercase h in your statements. In coding, everything is case sensitive (most languages)! Anywho, fixed that for ya =).

Here is a second download link that provides a sample level 2. I would suggest that if they get the answer correct go directly to level 2 instead of calling another function that calls it. That way you save lines of code and save yourself from confusion later on. Also methods that tell them they are incorrect are kinda not needed but I'll let you find a creative solution for that :). Again, I used your line of reasoning for example purposes. So that means in level2, if you get the question right (its a tough one!), then it calls cr2 etc..

One last thing. Since your quiz is a Batch file, the user can just open it up to find the answers. My suggestion is in the final version, make new questions and convert it to a .exe .