Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 RPG Game - First One Done :I
Index -> Programming, Turing -> Turing Submissions
Goto page 1, 2  Next
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Sean




PostPosted: Thu Nov 29, 2007 12:38 pm   Post subject: RPG Game - First One Done :I

Well, here is a quick RPG that I worked up in a day, not really finished. Really just a fighting RPG, 5 levels, defeat boss then continues to a next version that will be better once I work on more!

code:
%Created by Sean
%StormNexus
%November 23rd 2007

View.Set ("title: StormNexus (The Turing RPG), position: middle, middle, nobuttonbar")

%Declare Variables
var Name : string

%Input for Name
put "Enter Your Chosen Name: " ..
get Name : *
cls

%Declare Variables
var Gendre : string

%Input for Gendre
put "Enter Your Gendre (Male/Female): " ..
get Gendre
cls

%Declare Variable
var Proffession : string

%Checks Gendre then displays possible proffessions
if Gendre = "Male" then
    put "Choose Your Proffession Wisely:"
    put "Fighter"
    put "Barbarian"
    put "Bard"
    put "Cleric"
    put "Wizard"
    put "Sorcerer"
    put "Palidan"
    put "Monk"
    put "Druid"
    put "Ranger"
    put "Rogue"
    put "Choice: " ..
    get Proffession
    cls
end if

if Gendre = "Female" then
    put "Choose Your Proffession Wisely:"
    put "Fighter"
    put "Barbarian"
    put "Bard"
    put "Cleric"
    put "Witch"
    put "Sorceress"
    put "Palidan"
    put "Monk"
    put "Druid"
    put "Ranger"
    put "Rogue"
    put "Choice: " ..
    get Proffession
    cls
end if

%Declare Variable
var Alliance : string

%Choosing Alliance
put "Choose Your Alliance Wisely:"
put "Dark Alliance"
put "Free Alliance"
put "Nothern Alliance"
put "Unallied"
put "Choice: " ..
get Alliance : *
cls


%Declare Variables
var weapon : string
var shield : string
var movement : string
var hitpoints : int := 0
var distance : int := 0
var ac : int := 0
var level : int := 1
var experience_points : int := 0
var heal : int := 0

%Checks Proffession inputed, and makes bio for char
if Proffession = "Fighter" then
    weapon := "Longsword"
    shield := "Tower Shield"
    ac := 15
    hitpoints := 13
    level := level
    experience_points := experience_points
    heal := 11
end if

if Proffession = "Palidan" then
    weapon := "Greatsword"
    shield := "Nothing"
    ac := 13
    hitpoints := 13
    level := level
    experience_points := experience_points
    heal := 11
end if

if Proffession = "Wizard" or Proffession = "Witch" or Proffession = "Sorcerer" or Proffession = "Sorceress" then
    weapon := "Mage Staff"
    shield := "Nothing"
    ac := 10
    hitpoints := 7
    level := level
    experience_points := experience_points
    heal := 5
end if

if Proffession = "Cleric" then
    weapon := "Mace"
    shield := "Tower Shield"
    ac := 15
    hitpoints := 10
    level := level
    experience_points := experience_points
    heal := 8
end if

if Proffession = "Barbarian" then
    weapon := "Greataxe"
    shield := "Nothing"
    ac := 13
    hitpoints := 14
    level := level
    experience_points := experience_points
    heal := 12
end if

if Proffession = "Bard" or Proffession = "Rogue" then
    weapon := "Short Sword"
    shield := "Small Shield"
    ac := 12
    hitpoints := 8
    level := level
    experience_points := experience_points
    heal := 6
end if

if Proffession = "Druid" then
    weapon := "Quarterstaff"
    shield := "Nothing"
    ac := 11
    hitpoints := 9
    level := level
    experience_points := experience_points
    heal := 7
end if

if Proffession = "Monk" then
    weapon := "Unarmed"
    shield := "Nothing"
    ac := 14
    hitpoints := 10
    level := level
    experience_points := experience_points
    heal := 8
end if

if Proffession = "Ranger" then
    weapon := "Longbow"
    shield := "Nothing"
    ac := 13
    hitpoints := 11
    level := level
    experience_points := experience_points
    heal := 9
end if

%Beginning of Bio, Makes your bio appear and asks for input
loop
    put "Welcome, ", Name, " ", Proffession, " of the ", Alliance
    put "Weapon: ", weapon
    put "Sheild: ", shield
    put "Armor Class: ", ac
    put "Hitpoints: ", hitpoints
    put "Level: ", level
    put "Experience Points: ", experience_points
    put "Distance: ", distance
    put "Movement: " ..
    get movement
    cls

    if movement = "Right" then
        distance := distance + 5
    end if

    if movement = "Left" then
        distance := distance - 5
    end if

    if movement = "Up" then
        distance := distance + 5
    end if

    if movement = "Down" then
        distance := distance - 5
    end if

    var thief_hitpoints : int := 0
    var action : string

    if level = 1 and distance = 30 then
        cls
        thief_hitpoints := thief_hitpoints + 20
        loop
            put "You have encountered a Theif!"
            put "Your Hitpoints: ", hitpoints
            put "Enemy Hitpoints: ", thief_hitpoints
            put "Action (Attack/Heal/Cast Spell): " ..
            get action
            cls

            if action = "Attack" then
                hitpoints := hitpoints - 2
                thief_hitpoints := thief_hitpoints - 5
            end if

            if action = "Heal" then
                hitpoints := hitpoints - 2
                hitpoints := hitpoints + 1
            end if

            if action = "Cast Spell" and Proffession = "Witch" or Proffession = "Wizard" or Proffession = "Sorcerer" or Proffession = "Sorceress" then
                hitpoints := hitpoints - 1
                thief_hitpoints := thief_hitpoints - 5
            end if

            if thief_hitpoints = 0 then
                experience_points := experience_points + 500
                hitpoints := hitpoints + heal - 3
            end if

            exit when experience_points = 500 or hitpoints = 0
        end loop

    end if

    if level = 1 and distance = 60 then
        cls
        thief_hitpoints := thief_hitpoints + 20
        loop
            put "You have encountered a Theif!"
            put "Your Hitpoints: ", hitpoints
            put "Enemy Hitpoints: ", thief_hitpoints
            put "Action (Attack/Heal/Cast Spell): " ..
            get action
            cls

            if action = "Attack" then
                hitpoints := hitpoints - 2
                thief_hitpoints := thief_hitpoints - 5
            end if

            if action = "Heal" then
                hitpoints := hitpoints - 2
                hitpoints := hitpoints + 1
            end if

            if action = "Cast Spell" and Proffession = "Witch" or Proffession = "Wizard" or Proffession = "Sorcerer" or Proffession = "Sorceress" then
                hitpoints := hitpoints - 1
                thief_hitpoints := thief_hitpoints - 5
            end if

            if thief_hitpoints = 0 then
                experience_points := experience_points + 500
                hitpoints := hitpoints + heal - 3
            end if

            exit when experience_points = 1000 or hitpoints = 0
        end loop

        if experience_points = 1000 then
            ac := ac + 1
            weapon := weapon
            level := level + 1
            hitpoints := hitpoints + hitpoints
        end if

    end if

    if level = 2 and distance = 90 then
        cls
        thief_hitpoints := thief_hitpoints + 30
        loop
            put "You have encountered a Knight!"
            put "Your Hitpoints: ", hitpoints
            put "Enemy Hitpoints: ", thief_hitpoints
            put "Action (Attack/Heal/Cast Spell): " ..
            get action
            cls

            if action = "Attack" then
                hitpoints := hitpoints - 3
                thief_hitpoints := thief_hitpoints - 6
            end if

            if action = "Heal" then
                hitpoints := hitpoints - 2
                hitpoints := hitpoints + 1
            end if

            if action = "Cast Spell" and Proffession = "Witch" or Proffession = "Wizard" or Proffession = "Sorcerer" or Proffession = "Sorceress" then
                hitpoints := hitpoints - 1
                thief_hitpoints := thief_hitpoints - 6
            end if

            if thief_hitpoints = 0 then
                experience_points := experience_points + 500
                hitpoints := hitpoints + heal - 3
            end if

            exit when experience_points = 1500 or hitpoints = 0
        end loop

    end if

    if level = 2 and distance = 120 then
        cls
        thief_hitpoints := thief_hitpoints + 30
        loop
            put "You have encountered a Knight!"
            put "Your Hitpoints: ", hitpoints
            put "Enemy Hitpoints: ", thief_hitpoints
            put "Action (Attack/Heal/Cast Spell): " ..
            get action
            cls

            if action = "Attack" then
                hitpoints := hitpoints - 3
                thief_hitpoints := thief_hitpoints - 6
            end if

            if action = "Heal" then
                hitpoints := hitpoints - 2
                hitpoints := hitpoints + 1
            end if

            if action = "Cast Spell" and Proffession = "Witch" or Proffession = "Wizard" or Proffession = "Sorcerer" or Proffession = "Sorceress" then
                hitpoints := hitpoints - 1
                thief_hitpoints := thief_hitpoints - 6
            end if

            if thief_hitpoints = 0 then
                experience_points := experience_points + 500
                hitpoints := hitpoints + heal - 3
            end if

            exit when experience_points = 2000 or hitpoints = 0
        end loop

        if experience_points = 2000 then
            ac := ac + 1
            weapon := weapon
            level := level + 1
            hitpoints := hitpoints + hitpoints + heal + 4
        end if

    end if

    if level = 3 and distance = 150 then
        cls
        thief_hitpoints := thief_hitpoints + 40
        loop
            put "You have encountered an Orc!"
            put "Your Hitpoints: ", hitpoints
            put "Enemy Hitpoints: ", thief_hitpoints
            put "Action (Attack/Heal/Cast Spell): " ..
            get action
            cls

            if action = "Attack" then
                hitpoints := hitpoints - 2
                thief_hitpoints := thief_hitpoints - 5
            end if

            if action = "Heal" then
                hitpoints := hitpoints - 2
                hitpoints := hitpoints + 1
            end if

            if action = "Cast Spell" and Proffession = "Witch" or Proffession = "Wizard" or Proffession = "Sorcerer" or Proffession = "Sorceress" then
                hitpoints := hitpoints - 1
                thief_hitpoints := thief_hitpoints - 5
            end if

            if thief_hitpoints = 0 then
                experience_points := experience_points + 500
                hitpoints := hitpoints + heal - 3
            end if
            if hitpoints = 0 then
                cls
                var font1 : int
                font1 := Font.New ("serif:40")
                drawfillbox (maxx, maxy, 0, 0, brightred)
                Draw.Text ("Your Dead", 300, 150, font1, white)
            end if
            exit when experience_points = 2500
        end loop
    end if

    if level = 3 and distance = 180 then
        cls
        thief_hitpoints := thief_hitpoints + 40
        loop
            put "You have encountered an Orc!"
            put "Your Hitpoints: ", hitpoints
            put "Enemy Hitpoints: ", thief_hitpoints
            put "Action (Attack/Heal/Cast Spell): " ..
            get action
            cls

            if action = "Attack" then
                hitpoints := hitpoints - 2
                thief_hitpoints := thief_hitpoints - 5
            end if

            if action = "Heal" then
                hitpoints := hitpoints - 2
                hitpoints := hitpoints + 1
            end if

            if action = "Cast Spell" and Proffession = "Witch" or Proffession = "Wizard" or Proffession = "Sorcerer" or Proffession = "Sorceress" then
                hitpoints := hitpoints - 1
                thief_hitpoints := thief_hitpoints - 5
            end if

            if thief_hitpoints = 0 then
                experience_points := experience_points + 500
                hitpoints := hitpoints + heal - 3
            end if

            exit when experience_points = 3000 or hitpoints = 0
        end loop

        if experience_points = 3000 then
            ac := ac + 1
            weapon := weapon
            level := level + 1
            hitpoints := hitpoints + hitpoints + heal + 4
        end if
    end if

    if level = 4 and distance = 210 then
        cls
        thief_hitpoints := thief_hitpoints + 50
        loop
            put "You have encountered a Zombie!"
            put "Your Hitpoints: ", hitpoints
            put "Enemy Hitpoints: ", thief_hitpoints
            put "Action (Attack/Heal/Cast Spell): " ..
            get action
            cls

            if action = "Attack" then
                hitpoints := hitpoints - 2
                thief_hitpoints := thief_hitpoints - 5
            end if

            if action = "Heal" then
                hitpoints := hitpoints - 2
                hitpoints := hitpoints + 1
            end if

            if action = "Cast Spell" and Proffession = "Witch" or Proffession = "Wizard" or Proffession = "Sorcerer" or Proffession = "Sorceress" then
                hitpoints := hitpoints - 1
                thief_hitpoints := thief_hitpoints - 5
            end if

            if thief_hitpoints = 0 then
                experience_points := experience_points + 500
                hitpoints := hitpoints + heal - 3
            end if

            exit when experience_points = 3500 or hitpoints = 0
        end loop
    end if

    if level = 4 and distance = 240 then
        cls
        thief_hitpoints := thief_hitpoints + 50
        loop
            put "You have encountered a Zombie!"
            put "Your Hitpoints: ", hitpoints
            put "Enemy Hitpoints: ", thief_hitpoints
            put "Action (Attack/Heal/Cast Spell): " ..
            get action
            cls

            if action = "Attack" then
                hitpoints := hitpoints - 2
                thief_hitpoints := thief_hitpoints - 5
            end if

            if action = "Heal" then
                hitpoints := hitpoints - 2
                hitpoints := hitpoints + 1
            end if

            if action = "Cast Spell" and Proffession = "Witch" or Proffession = "Wizard" or Proffession = "Sorcerer" or Proffession = "Sorceress" then
                hitpoints := hitpoints - 1
                thief_hitpoints := thief_hitpoints - 5
            end if

            if thief_hitpoints = 0 then
                experience_points := experience_points + 500
                hitpoints := hitpoints + heal - 3
            end if

            exit when experience_points = 4000 or hitpoints = 0
        end loop

        if experience_points = 4000 then
            ac := ac + 1
            weapon := weapon
            level := level + 1
            hitpoints := hitpoints + hitpoints + heal + 4
        end if
    end if

    var boss_hp : int := 0

    if level = 5 and distance = 270 then
        cls
        boss_hp := boss_hp + 200
        loop
            put "You have encountered a Dragon Knight!"
            put "Your Hitpoints: ", hitpoints
            put "Enemy Hitpoints: ", boss_hp
            put "Action (Attack/Heal/Cast Spell): " ..
            get action
            cls

            if action = "Attack" then
                hitpoints := hitpoints - 3
                boss_hp := boss_hp - 10
            end if

            if action = "Heal" then
                hitpoints := hitpoints - 2
                hitpoints := hitpoints + 1
            end if

            if action = "Cast Spell" and Proffession = "Witch" or Proffession = "Wizard" or Proffession = "Sorcerer" or Proffession = "Sorceress" then
                hitpoints := hitpoints - 2
                boss_hp := boss_hp - 10
            end if

            if boss_hp = 0 then
                experience_points := experience_points + 1000
                hitpoints := hitpoints + heal - 3
            end if

            exit when experience_points = 5000 or hitpoints = 0
        end loop
    end if
    exit when experience_points = 5000 or hitpoints = 0
end loop

if hitpoints = 0 then
    cls
    var font1 : int
    font1 := Font.New ("serif:40")
    drawfillbox (maxx, maxy, 0, 0, brightred)
    Draw.Text ("Your Dead", 175, 200, font1, white)
end if

if experience_points = 5000 then
    cls
    put "After numerous battles, ", Name, "faught brilliantly."
    put weapon, "s collided, wounds were opened."
    put "With the final blow, a great white light emerged,"
    put "And all that was left, was the cloak of ", Name
    put "Where has he gone? To be continued.."
end if



Hope you enjoy my completely boring RPG Razz

If I had more experience or if i had a better Idea, then maybe I would make a better one.
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Thu Nov 29, 2007 1:48 pm   Post subject: RE:RPG Game - First One Done :I

Just glanced over it, some things that I noticed:

You spelled 'profession' and 'gender' wrong.

When choosing the class, the only thing different is the spelling of a few of them. Your two if statements could be condensed to this:

code:

%since gender only matters for Wizard and Sorcerer, we only should check for those.
put "Choose Your Profession Wisely:"
put "Fighter"
put "Barbarian"
put "Bard"
put "Cleric"
if gender = "Male" then
    put "Wizard"
    put "Sorcerer"
else
    put "Witch"
    put "Sorceress"
end if
put "Paladin"
put "Monk"
put "Druid"
put "Ranger"
put "Rogue"
put "Choice: " ..
get Profession
cls


Also, you don't make sure that the input is valid. I could put my profession as student and your program wouldn't mind. To catch this, put your input in a loop (play with this code to understand better):
code:
loop
    put "Choose foo or bar"
    var input : string
    get input
    exit when input = "foo" or input = "bar"
    put "Invalid choice."
end loop


Good work, by the way. You should look up how to use functions and procedures next.
Clayton




PostPosted: Thu Nov 29, 2007 6:08 pm   Post subject: RE:RPG Game - First One Done :I

code:

experience_points := experience_points


Am I missing something here?
Gooie




PostPosted: Mon Dec 03, 2007 12:28 am   Post subject: Re: RPG Game - First One Done :I

Um... Sean, this is super unnecessarily bulky. Try elsif one and awhile. I also couldn't find a single piece of usable documentation here. unless you consider...
code:
%Declare Variables

...as such.
cavetroll




PostPosted: Mon Dec 03, 2007 3:29 pm   Post subject: RE:RPG Game - First One Done :I

First of all, it should say "you're dead" not "your dead" because the later refers to possession i.e that is your ball.

Second of all,
code:

put "Action (Attack/Heal/Cast Spell): " ..
get action

should be
code:

put "Action (Attack/Heal/Cast Spell): " ..
get action  :*

so the user can enter two words, i.e. "Cast Spell"
the ":*" allows users to enter spaces

Third of all, you should tell them which directions to choose because i wasn't sure if you meant north or up. Had to look at the code to check.


Other than those and the errors stated above I found no other problems.
schwarp




PostPosted: Tue Apr 15, 2008 6:52 pm   Post subject: RE:RPG Game - First One Done :I

Well I noticed while playing the game, that :
-There is no instructions
-You have to put in your choices (Up, Down, etc.) with Capitals, easy to fix, but still rather annoying.
-If you are suppose during a battle, against a Knight or anything else, the health goes into the negative instead, and then you keep fighting until you win, and then just keep going.
-While in a battle, if you try to heal, it does not work what so ever. You lose 1 life, at least, each time.
- You do not get into any fights, if you go left. The number simply goes into the negative, and nothing happens.


I think that is enough to start with, and then maybe others can through in what they found.

Other than that, it was ok. It could use SOME graphics, to make this mildly entertaining.
Nick




PostPosted: Tue Apr 15, 2008 7:12 pm   Post subject: RE:RPG Game - First One Done :I

/me notes his RPG got a better review from schwarp
Sean




PostPosted: Tue Apr 15, 2008 7:25 pm   Post subject: RE:RPG Game - First One Done :I

I'd like to inform you that this is way old, and that was when I was practically new to Turing.

However, I am now working on a Graphics RPG, takes forever to make though.
Sponsor
Sponsor
Sponsor
sponsor
crysis




PostPosted: Wed Apr 16, 2008 8:29 am   Post subject: RE:RPG Game - First One Done :I

fun game
Michael516




PostPosted: Wed Apr 16, 2008 8:30 am   Post subject: RE:RPG Game - First One Done :I

i liked it but it needs some insructions
crysis




PostPosted: Wed Apr 16, 2008 8:31 am   Post subject: RE:RPG Game - First One Done :I

instructions would be great and color
repsoccer16




PostPosted: Wed Apr 16, 2008 8:33 am   Post subject: RE:RPG Game - First One Done :I

ya true enough
crysis




PostPosted: Wed Apr 16, 2008 8:33 am   Post subject: RE:RPG Game - First One Done :I

and could u plz post the code so others can understand it
Michael516




PostPosted: Wed Apr 16, 2008 8:34 am   Post subject: RE:RPG Game - First One Done :I

the code is posted
crysis




PostPosted: Wed Apr 16, 2008 8:36 am   Post subject: RE:RPG Game - First One Done :I

sry i must have posteed in the rong 1 i was thinking of another
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 2  [ 17 Posts ]
Goto page 1, 2  Next
Jump to:   


Style:  
Search: