
-----------------------------------
AlexIbrahim
Thu Jun 03, 2004 9:25 am

My Matrix Procject
-----------------------------------
My question is how Do I make it so when the user clicks on thr Blue pill , it does one thing and if they click on the Red pill it does something. We haven't learnt how to do that yet :D

heres the code 

var font1, font2,font3 : int
colourback (7)
cls
font1 := Font.New ("Impact:72")
font2 := Font.New ("Times New Roman:20:bold")
font3 := Font.New  ("Times New Roman:15:bold")
assert font1 > 0
%for c : 1 .. 1000
var letter : string 

var row, col, colour_, character : int
var characters : string := "0 1"
var continue : string (1)
var font : int
var Counter : int
var Delay : int
colourback (7)
Delay := 400

Font.Draw ("You will now be given the choice of two pills", 50, 200, font3, 0)
Font.Draw ("The Red pill will give you back your normal life ...", 50, 220, font3, 0)
Font.Draw ("The blue pill will let you know the real world ..The Matrix", 50, 240, font3, 0)
Font.Draw ("Press B for Blue Pill , Press R for Red Pill", 50, 260, font3, 0)
%Blue 
Font.Draw ("B", 80, 150, font2, 32)
delay (Delay)
Font.Draw ("L", 100, 150, font2, 32)
delay (Delay)
Font.Draw ("U", 120, 150, font2, 32)
delay (Delay)
Font.Draw ("E", 140, 150, font2, 32)
drawfilloval (120,70,20,30,32)
%Red
Font.Draw ("R", 460, 150, font2, 4)
delay (Delay)
Font.Draw ("E", 480, 150, font2, 4)
delay (Delay)
Font.Draw ("D", 500, 150, font2, 4)
drawfilloval (500,70,20,30,4)
[/code]

-----------------------------------
Delos
Thu Jun 03, 2004 11:08 am


-----------------------------------
1)  Learn how to use [ code] tags properly.
2)  You may want to invest in a dictionary...but then again, typsos are so common that you shouldn't owrry too much.
3)  Use if's...[url=http://www.compsci.ca/v2/viewtopic.php?t=367]As described here.

-----------------------------------
Cervantes
Thu Jun 03, 2004 2:38 pm


-----------------------------------
more basic then ifs, you need to learn to use get.  
here's a quick tutorial.


var name : string
get name


get will pause the program and wait for the user to input something.  the program will resume when enter is pressed.  Whatever the user types in becomes the new value of the variable just after "get".  in this case, if the user types in "Steve" and presses enter, the variable "name" is now equal to "Steve".

-----------------------------------
aside
Thu Jun 03, 2004 2:41 pm


-----------------------------------
use mousewhere then check with whatdotcolour.

-----------------------------------
Cervantes
Thu Jun 03, 2004 2:58 pm


-----------------------------------
use mousewhere then check with whatdotcolour.

We're going for a simple solution here.  Also, the program says "Press B" or "Press R", not click.  :?
