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

Username:   Password: 
 RegisterRegister   
 Multiple choice adventure game
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Carey




PostPosted: Wed Apr 12, 2006 10:20 am   Post subject: Multiple choice adventure game

This is an adventure game. My brother made up the story for it, and I wrote the code. (admittedly a weak story, but hey, he's only 11) Is there a way to get rid of some of the if statements?


The Evil Spirit Series.t
 Description:

Download
 Filename:  The Evil Spirit Series.t
 Filesize:  48.06 KB
 Downloaded:  243 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
ZeroPaladn




PostPosted: Wed Apr 12, 2006 12:12 pm   Post subject: (No subject)

perhaps you can make it beatable, but its a neat start.
codemage




PostPosted: Wed Apr 12, 2006 12:36 pm   Post subject: (No subject)

That's a pretty good start! Congrats for the first publication of Metcalfe bros. studios. Wink

A few things that you can quickly to do clean up your code:

You can declare and initialize variables on the same line like this:

code:
var bombs :int := 0


You also have a procedure that you're using for death. If you used procedures for each of the rooms or situations you can be in, you wouldn't have to deal with your massive embedded loops.

Here's pseudocode:
code:
procedure firstroom
put stuff
if choice = "a" then
  secondroom
else
  die
end if
end firstroom
Carey




PostPosted: Thu Apr 13, 2006 9:45 am   Post subject: Cheat sheet

I have made a cheat sheet for the game so you can beat it the easy way. Rolling Eyes

here it is

gamename
firstname
lastname
b
a
a
b
a
b
b
a
b
flute
a
c
b
a
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 1  [ 4 Posts ]
Jump to:   


Style:  
Search: