This is my Debut Solo Project in Turing
Author |
Message |
Zampano
|
Posted: Sun Sep 09, 2007 1:03 am Post subject: This is my Debut Solo Project in Turing |
|
|
I created this after 4 periods of instruction on Object Oriented Turing 4.0.
It's lame, but it's my beginning project.
var command:string
var enhealth,youhealth:int
put "A goblin has attacked you."
put "Fight back by entering battle commands or perish!"
enhealth:=200
youhealth:=100
loop
put "Enter a command."
put "(A)Attack"
put "(B)Heal"
put "(C)Nothing"
get command
if command="A" or command="a" then
put "You chose to attack."
enhealth:=enhealth-15
youhealth:=youhealth-10
put "You damaged your enemy for 15 points."
put "Your enemy damaged you for 10 points."
put "Your current health is ",youhealth,"/100."
elsif command="B" or command="b" then
put "You chose to heal."
youhealth:=youhealth+40
if youhealth>100 then
youhealth:=100
end if
youhealth:=youhealth-10
put "You healed yourself for 40 points."
put "Your enemy damaged you for 10 points."
put "Your current health is ",youhealth,"/100."
elsif command="C" or command="c" then
put "You chose to do nothing."
youhealth:=youhealth-10
put "Your enemy damaged you for 10 points."
put "Your current health is ",youhealth,"/100."
else
put "Invalid battle command."
end if
exit when youhealth<=0 or enhealth<=0
end loop
if enhealth<=0 and youhealth>0 then
put "You won the battle against the very weak enemy. Conglaturation!"
elsif youhealth<=0 and enhealth>0 then
put "You lost to one of the lamest enemies conceivable. How very anticlimactic."
elsif youhealth<=0 and enhealth<=0 then
put "You killed your opponent, but as he lay dying he dealt unto you the final blow; you fell as well."
end if
[/list] |
|
|
|
|
|
Sponsor Sponsor
|
|
|
Dan
|
Posted: Mon Sep 10, 2007 6:03 am Post subject: Re: This is my Debut Solo Project in Turing |
|
|
It is not a bad start for having just started turing. It could still use some work to make it more fun to play but i am shure you will add to it as you go.
When posting code on this site you can make it look nice by using the bbcode syntax, and in the ""s put the name of the langue. So for turing you could do:
code: |
[syntax="turing"]
put "hello"
[/syntax]
|
And it will look like this:
|
Computer Science Canada
Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more! |
|
|
|
|
Tony
|
Posted: Mon Sep 10, 2007 11:51 am Post subject: RE:This is my Debut Solo Project in Turing |
|
|
It's really cool to see someone jump into programming like that, and already posting code after 4 classes.
I see that you're already familiar with a lot of basic concepts: variables, loops, if statements.
If you want to jump a little bit ahead, and make your game a bit more dynamic, a good place to start would be to throw some random values in there, just to mix things up a bit. (You shouldn't be able to always damage for 15 points exact)
Turing: |
damage := Rand.Int(10,20)
|
|
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
CodeMonkey2000
|
Posted: Mon Sep 10, 2007 5:27 pm Post subject: RE:This is my Debut Solo Project in Turing |
|
|
You should use all the resources provided right here. Check out the Turing Walkthrough. If you want to pursue your RPG, read up on classes (once you have enough experience of course). |
|
|
|
|
|
Zampano
|
Posted: Wed Sep 12, 2007 9:09 am Post subject: Re: This is my Debut Solo Project in Turing |
|
|
Thanks all for the advice and help, guys. I'm going to continue with Turing and other languages and eventually, I will make games better than these.
I'll definately be looking into the user tutorials as well. |
|
|
|
|
|
UraniumLobster
|
Posted: Wed Sep 12, 2007 10:09 am Post subject: RE:This is my Debut Solo Project in Turing |
|
|
Im new to turing too, and I don't know how to do that yet... haha |
|
|
|
|
|
|
|