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

Username:   Password: 
 RegisterRegister   
 Can we get some help?
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
MikeJake




PostPosted: Fri Jan 09, 2009 1:45 pm   Post subject: Can we get some help?

We've started this game, and i was wondering if anyone has any idea of how to make a map.

if you can, please tell us.

This is what we have so far:

Turing:

import GUI

GUI.SetBackgroundColour (green)

procedure Start
GUI.Quit
end Start

var b1 := GUI.CreateButton (120, 250, 10, "Start Game", Start )
loop
    exit when GUI.ProcessEvent
end loop

var Name : string

put "Enter your soldier's name. " ..
get Name : *
cls

var Gender : string

put "Enter your Gender: " ..
get Gender
cls

var Specialty : string

if Gender = "Male" then
put "Choose your specialty from the list below"
put "Engineer"
put "Infantry"
put "Communications"
put "Armoured"
put "Artillery"
put "Medic"
put "Military Police"
put " " ..
cls
end if

if Gender = "Female" then
put "Choose your specialty from the list below"
put "Engineer"
put "Infantry"
put "Communications"
put "Armoured"
put "Artillery"
put "Medic"
put "Military Police"
put " " ..
cls
end if

var Corps : string

put "Choose your Corps. or Division"
put "Marine Corps."
put "Canadian Army"
put " " ..
get Corps : *
cls

var Regiment : string

if Corps = "Canadian Army" then
put "Choose a regiment"
put "The Essex and Kent Scottish"
put "The Lake Superior Highlanders"
put "The Black Watch Royal Highland Regiment of Canada"
put "Princess Patricia's Canadian Light Infantry"
put "Royal Canadian Electrical and Mechanical Engineers"
put "Royal Canadian Field Ambulance"
put "Lord Strathcona's Horse"
put "Royal Canadian Horse Artillery"
put "Canadian Military Police"
put "Canadian Signal Corps."
put "Royal Canadian Regiment"
put " " ..
get Regiment
cls
end if

if Corps = "Marine Corps." then
put "Choose a company."
put "Alpha"
put "Bravo"
put "Charlie"
put "Delta"
put "Echo"
put "Foxtrot"
put "Gulf"
put "Hotel"
put "India"
put "Juliette"
put "Kilo"
put " " ..
get Regiment
cls
Sponsor
Sponsor
Sponsor
sponsor
DemonWasp




PostPosted: Fri Jan 09, 2009 1:51 pm   Post subject: RE:Can we get some help?

First thing you want to do is learn if-elsif-end if and use that instead of the multiple if statements per variable.

Second thing you want to do is realise that the lists are the same between male and female occupations and eliminate the if structure around that, as it's irrelevant.

Third, you get to decide: is your game going to use pictures and graphics, or it is just going to use text? Text is easier, but doesn't look as good as pictures.
syntax_error




PostPosted: Fri Jan 09, 2009 7:16 pm   Post subject: RE:Can we get some help?

Load your 'map' of whatever you want into a text file, making each object a letter and such then reading it off that file and outputting on the screen.
MikeJake




PostPosted: Mon Jan 12, 2009 11:55 am   Post subject: Re: Can we get some help?

Ok, we worked on it, and we would like to know what you think of it so far, and please, tell us where improvements can be made.

[syntax=""]%%%The Army Game%%%
%By: Mike Orr and Jake Klassen%

import GUI

GUI.SetBackgroundColour (green)

procedure Start
GUI.Quit
end Start

var b1 := GUI.CreateButton (120, 250, 10, "Start Game", Start )
loop
exit when GUI.ProcessEvent
end loop

cls



put "Its Time To Fight"

var Name : string

put "Enter your soldier's name. " ..
get Name : *


var Gender : string

put "Enter your Gender: " ..
get Gender


var Specialty : string

if Gender = "Male" then
put "Choose your specialty from the list below"
put "Engineer"
put "Infantry"
put "Communications"
put "Armoured"
put "Artillery"
put "Medic"
put "Military Police"
put "Airborne"
put "Ammunition Technician"
put " " ..
get Specialty
end if

if Gender = "Female" then
put "Choose your specialty from the list below"
put "Communications"
put "Artillery"
put "Medic"
put " " ..
get Specialty
end if


var Corps : string

put "Choose your Corps. or Division"
put "Marine Corps."
put "Canadian Army"
put "Army Cadet"
put " " ..
get Corps : *


var Regiment : string

if Corps = "Canadian Army" then
put "Choose a regiment"
put "The Essex and Kent Scottish"
put "The Lake Superior Highlanders"
put "The Black Watch Royal Highland Regiment of Canada"
put "Princess Patricia's Canadian Light Infantry"
put "Royal Canadian Electrical and Mechanical Engineers"
put "Royal Canadian Field Ambulance"
put "Lord Strathcona's Horse"
put "Royal Canadian Horse Artillery"
put "Canadian Military Police"
put "Canadian Signal Corps."
put "Royal Canadian Regiment"
put " " ..
get Regiment

end if

if Corps = "Marine Corps." then
put "Choose a company."
put "Alpha"
put "Bravo"
put "Charlie"
put "Delta"
put "Echo"
put "Foxtrot"
put "Gulf"
put "Hotel"
put "India"
put "Juliette"
put "Kilo"
put " " ..
get Regiment

if Corps = "Army Cadet" then
put "Choose your corps."
put "59 LHRC(ARMY)CC"
put "1084 Walkerville Legion"
put "CC 04 Blackwatch"
put "#44 Port Perry"
put " " ..
get Regiment


end if

var Weapon : string
put "Choose your weapon"
put "Colt Canada C7"
put "Colt Canada C6"
put "Colt Canada C8"
put "Colt Canada C9"
put "Armalite M-14"
put "Armalite M-15"
put "Armalite M-16"
put "M1 Carbine"
put "Remmington .22, semi auto"
put "Daisy 853C"
put "Lee Enfield No. 7 Bolt Action, Rim Fire, 22 calibre Rifle"
put " " ..
get Weapon
end if
cls

var User_Specialty : string
var User_XP : real
var User_CurrentHealth : real
var User_NextLevel : real
var WeaponDamage: int

if User_Specialty = "Engineer" then
User_CurrentHealth :=100
User_XP :=0
User_NextLevel := 200
end if

if User_Specialty = "Infantry" then
User_CurrentHealth :=100
User_XP :=0
User_NextLevel := 1000
end if

if User_Specialty = "Communications" then
User_CurrentHealth :=100
User_XP :=0
User_NextLevel := 100
end if

if User_Specialty = "Armoured" then
User_CurrentHealth :=100
User_XP :=0
User_NextLevel := 400
end if

if User_Specialty = "Artillery" then
User_CurrentHealth :=100
User_XP :=0
User_NextLevel := 500
end if

if User_Specialty = "Medic" then
User_CurrentHealth :=100
User_XP :=0
User_NextLevel := 700
end if

if User_Specialty = "Military Police" then
User_CurrentHealth :=100
User_XP :=0
User_NextLevel := 350
end if

if User_Specialty = "Airborne" then
User_CurrentHealth :=100
User_XP :=0
User_NextLevel := 950
end if

if User_Specialty = "Ammunition Technician" then
User_CurrentHealth :=100
User_XP :=0
User_NextLevel := 470
end if



[/syntax][/code]
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 4 Posts ]
Jump to:   


Style:  
Search: