Computer Science Canada

test my first game

Author:  jedi-bob [ Tue Jan 20, 2004 3:03 pm ]
Post subject:  test my first game

it is not done yet, i need to more/other levels this is just the basic concept, and i wanted to get some feedback on how it is so far.



colorback (255)
cls
color (10)
locate(10,24)
put"Welcome to.........."
delay(1000)
cls
locate(10,5)
put"Guy Who runs from ''bad'' people who may or may not violently execute him"
delay(5000)
cls
put"Instuctions"
locate(5,1)
put"Get to the goal without being seen by enemies."
delay(2000)
cls
put"These are the enemies"
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(3000)
cls
put"This is what the enemy looks like"
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
delay(500)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
delay(500)
drawfilloval(500,200,10,10,red)delay(500)
drawfilloval(500,200,50,50,yellow)
delay(500)
drawfilloval(500,200,10,10,red)
delay(750)
cls
put"This is the area where he will see or hear you"
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(1500)
drawfilloval(500,200,50,50,black)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,black)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,black)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,black)
drawfilloval(500,200,10,10,red)
delay(500)
drawfilloval(500,200,50,50,yellow)
drawfilloval(500,200,10,10,red)
delay(750)
cls
put"If you go into his area of vision, or hearing, you will be caught and killed"
%borrowed
delay(1500)
Draw.FillBox (0, 0, maxx, maxy, 255)
colorback (255)
color (10)
var zz : int := 1
for i : 1 .. 100
delay (50)
Draw.FillBox (100, 15, 100 + zz, 25, 54)
Draw.Box (100, 15, 200, 25, 1)
zz := zz + 1
locate (23, 13)
put "Loading... ", zz, "%" ..
end for
locate (23, 13)
put "Done Loading! " ..
delay(1000)
colorback(white)
cls
%main character
var a,b : int
a:=100
b:=100
%enemy 1
var a2,b2: int
a2:=500
b2:=200
%enemy 2
var a3,b3: int
a3:=200
b3:=100
%goal
var g1,g2 : int
g1:=620
g2:=370

var chars : array char of boolean
loop
Input.KeyDown (chars)

if chars (KEY_UP_ARROW) then
drawfilloval(a,b,10,10,white)
b:=b+3
end if
if chars (KEY_RIGHT_ARROW) then
drawfilloval(a,b,10,10,white)
a:=a+3
end if
if chars (KEY_LEFT_ARROW) then
drawfilloval(a,b,10,10,white)
a:=a-3
end if
if chars (KEY_DOWN_ARROW) then
drawfilloval(a,b,10,10,white)
b:=b-3
end if

drawfilloval(a,b,10,10,red)
delay(10)

drawfilloval(a2,b2,50,50,yellow)
drawfilloval(a2,b2,10,10,red)

drawfilloval(a3,b3,50,50,yellow)
drawfilloval(a3,b3,10,10,red)

drawoval(620,370,20,20,black)

var distance := ((a2-a)*(a2-a) + (b2-b)*(b2-b))**0.5
var distance2 := ((a3-a)*(a3-a) + (b3-b)*(b3-b))**0.5
var distance3 := ((g1-a)*(g1-a) + (g2-b)*(g2-b))**0.5
var radius1:=10
var radius2:=50
var radius3:=20
%you take the square of differences of X coordinates and add
%a square of differences of Y coordinates then take a square
%root of the sum
%%%%%%
%I did (x)*(x) instead of x**2 because exponents is a function
%and it takes up more resourses then *, thus its faster
%Also **0.5 is the same as sqrt() - learn your math guys
if distance < radius1 + radius2

%might be a good idea to save radious1+radious2 as const/var
then
colorback(black)
cls
put"You have been spotted, the enemy has captured and killed you."
delay(2000)
exit
elsif distance2 < radius1 + radius2
then
colorback(black)
cls
put"You have been spotted, the enemy has violently executed you."
delay(2000)
exit

elsif distance3 < radius1 + radius3
then
colorback(black)
cls
put"You made it to the goal."
delay(2000)
exit

end if

end loop
cls
delay(1000)
quit


PS- thanks for the loading bar dan shadow

Author:  the_short1 [ Tue Jan 20, 2004 5:31 pm ]
Post subject: 

good start.... one suggestion.. make the delays smaller... not everyone has a WICKED FAST COMPUTER, if your running an old Pentium 1 or 2... its realy slow... maybe ask the person like i do if you computers are fast or slow... if fast then (speeddelay := 2000) if slow then speeddelay := 1000 ... something like that... speeddelay is a variable i pulled outa my head for example...
code:

var comp : int
 loop
        locate (18, 40)
        put "Do you have a fast computer (y/n): " ..
        get yn
        if yn = "n" or yn = "N"
                then
            comp := 0
            exit
        elsif yn = "y" or yn = "Y" then
            comp := 20
            exit
        end if
    end loop

I took this from my text Twist Program...and i lied.. 2 suggestions...
because you program is long... maybe consider attaching it as a .t file

And your exit statement at end of program is an error.... are you running an older Turing version???, new ones can close the window... search for the_short1 for author and it will show you my post on closing window after program is finnished...Good Luck...

Author:  shorthair [ Fri Jan 23, 2004 10:16 am ]
Post subject: 

Good Concept to your game , but for times sake and waiting , ask if the user want to see the intro at the begining y/n , then also dont use those cursed loading bars , i acn make you a real one that actually does somthing if you must have it Laughing , but add in the suggestions we have given you and you should have a rockin game

Author:  DanShadow [ Fri Jan 23, 2004 10:22 am ]
Post subject: 

WOAH back it up....where the heck did you get that loading bar!! Thats the one used in my "Unholy Realms" Graphical RPG...and I HAVENT released the code for that!!! Now tell me where you got that from!!
(your welcome for it....but how did you get it)

Author:  shorthair [ Fri Jan 23, 2004 10:27 am ]
Post subject: 

HOw could you use such a thing Dan , i expect so much more from you Crying or Very sad

Author:  DanShadow [ Fri Jan 23, 2004 10:42 am ]
Post subject: 

lol....I did that because my teacher thought it looked neat (suprisingly) Laughing

Author:  kalin [ Fri Jan 23, 2004 3:19 pm ]
Post subject: 

Good Grief Boys I think that the 'game' is cool so far, you should have it so that the 'enemies' move around and whatnot. So yeah....and I think that if you work on it, it will be a really good game.

Author:  the_short1 [ Fri Jan 23, 2004 4:44 pm ]
Post subject: 

Good concept tho,... here is 2 bits... pretty good for a first game concept ...mine was Rock Paper Scissors... (well first one i finished... i have 3 on the Go) please include your program as a .t file please/..//

Author:  sport [ Fri Jan 23, 2004 7:06 pm ]
Post subject: 

The first part of the program (till the game starts) should be as a help file. You should ask the user if he wants to view it? The delays are ok for the help file. Take out the loading bar it is a waist of time.


: