Computer Science Canada

updated version of my FIRST GAME!!!

Author:  vagyb [ Sat Jul 10, 2004 8:03 am ]
Post subject:  updated version of my FIRST GAME!!!

i dont have a name for it yet, but i finally updated it again. this is my first "complex" game ever on turin so cut some slack lol Smile

Author:  Tony [ Sat Jul 10, 2004 1:42 pm ]
Post subject: 

nice, it's much more interesting now, but the meteors seem to be moving too fast (even on my computer) and I die within 10 seconds Laughing I think you should make it just a bit easier to keep user interested, not frustrated with the game Wink

such as slow down the meteor movement just a bit and/or make less of them.

an ideal solution would be to drop down those values, but then slowly increase them as the game progresses

Author:  Delos [ Sat Jul 10, 2004 3:42 pm ]
Post subject: 

Ditto tony

Instead of your 'getKey' procedure, it would be far easier to use an Input.Pause() routine.

wallclock...ummm why!
Time.Elapsed() works very well. And you can use the same sort of idea...set a var to Time.Elapsed()'s value as the game begins, and then check that against the Time.Elapsed() return value when the game ends...

"% end loop"
That had better not be an in-code comment...coz' if it'd be just a tiny bit depressing.

You can declare more than 1 variable on a single line:

var num1 : int
var num2 : int
var num3 : int

can be written as

var num1, num2, num3 : int

or even as

var nums : array 1..3 of int

Looking at your code and use of variables, you should really consider using types.


Read these...will show you much interesting stuff:

Arrays by tony
Arrays by Dodge
Records and Types by Dodge
And while you're at it...
High Scores List by Dan

Author:  the_short1 [ Sat Jul 10, 2004 5:59 pm ]
Post subject: 

good for a first program..

here is a couple code saving tips:


var boulderWidth : int
boulderWidth := Pic.Width (boulderPic)
 if boulder1X + boulderWidth <= 0 then
        boulder1X := maxx
        randint (boulder1Y, 1, maxy) %makes the placement of the astroids random after the first time they come

instead of making variables for each boulder size... u can do this..


if boulder1X + Pic.Width(boulderPic) <= 0 then %% notice the difference?
        boulder1X := maxx
        randint (boulder1Y, 1, maxy) %makes the placement of the astroids random after the first time they come

saves tons of lines of code.. cuz then u dont have all those variables..
and makes it cleaner/.

also... look into arrays as mentioned.. i wish i learned them earlier... my teacher would not teach me (until near end of year) .. and i ended up having to learn them myself.. but if i knew them earlier it woulda saved tons of time..

also... if u have a variable .. to save time..
instead of

var boulderPic : int
boulderPic := Pic.FileNew ("boulder.bmp")

u can go

var boulderpic : int := Pic.FileNew ("boulder.bmp")

u can make a variable have a value on the same line!

even works like this..

var b1,b2,b3 : int := 1

now b1,b2, and b3 all equal 1

but u even used non-default fonts! thats WICKED... very good for a first program.. looks like u did the research (turing reference) to get what u wanted done!

Font.Draw ("Created by: Vagharshak Bakhshyan", 100, 200,Font.New ("sherif:16), 40) %%% u can include the in the same line isntead of making var font1 : int

(see other thread i gave u 7 bits)

hope that helps u to enjoy coding better /and make it easier..
./. keep producing the good stuff

Author:  blackwhite [ Tue Jul 13, 2004 4:30 pm ]
Post subject: 

my score: 15 Smile yeah, it is a bit difficult

Author:  vagyb [ Fri Jul 23, 2004 6:38 am ]
Post subject: 

oh alrite thx alot for the reply guys, the problem is that if i do it on my computer its pretty slow hehe.

and tony i thought bout making it slower, then increasing speed. i have to get a bit more experience before i do that.

for now i'm practicing creating macro's, but once i'm done with that i'll get back to turing.

Author:  Tony [ Fri Jul 23, 2004 5:38 pm ]
Post subject: 

vagyb : for the increased speed, reduce the delay with a simple time related function, such as

put "*"..
delay(100 - round(Time.Elapsed/100))
end loop

though the acceleration is quite rapid, but that's just for the example's sake. Adjust the function as needed.