Computer Science Canada

Asteroid Game Asteroids!!!!!!!!!!

Author:  Witchcraft [ Sat Oct 13, 2007 8:36 pm ]
Post subject:  Asteroid Game Asteroids!!!!!!!!!!

ok so, im pretty new to programming, but im having a good start, im now at the point were im creating my first game. The game is suppost to be a game where you are a ship that dodges asteroids and other space objects. I have loaded the pictures (that i created myself in photoshop, just like to balance out the fact that im a noob programmer), which include the background, score bar and the ship itself. I have gotten the ship to move, so now im ready for the next step, which is the asteroids. So i've been playing around for some time and i have no idea were to start with the asteroids! What a want to happen is that asteroids appear at a random x value top of the screen, and slowly move down in a some what randome direction (somewhat meaning that there going in a general down direction) if you could help me that would be great, oh and here is the code i have so far (introduction will be added when the game is done)

%A shipe game where you dodge objects
View.Set ("graphics:500;500,position:center;center,nobuttonbar")
var x, y : int %x and y values
var key : array char of boolean %key being pressed down
var picID, picID2, picID3 : int %pictures for the game
var font1 : int %font style
var score, lives, level : int %score lives and lecel values
y := 25
x := 200
score := 0
lives := 3
level := 1
picID := Pic.FileNew ("Ship.bmp")
picID2 := Pic.FileNew ("Ship game bar.bmp")
picID3 := Pic.FileNew ("Ship Background.bmp")
font1 := Font.New ("BERKLEY:11:bold")
Pic.Draw (picID2, 0, 0, picCopy)
View.Set ("offscreenonly")
loop
colorback (black)
Input.KeyDown (key)
if key ('w') then
y := y + 5
end if

if key ('s') then
y := y - 5
end if
if key ('a') then
x := x - 5
end if

if key ('d') then
x := x + 5
end if

if y > 450 then
y := 450
end if
if x > 400 then
x := 400
end if
if x <= 0 then
x := 0
end if
if y <= 25 then
y := 25
end if
delay (30)
cls
Pic.Draw (picID3, 0, 0, picCopy)
Pic.Draw (picID, x, y, picMerge)
Pic.Draw (picID2, 0, 0, picCopy)
Font.Draw (intstr (score), 60, 5, font1, 2)
Font.Draw (intstr (lives), 330, 5, font1, 2)
Font.Draw (intstr (level), 450, 5, font1, 2)
View.Update
end loop

Author:  Carey [ Mon Oct 15, 2007 12:00 pm ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

no one can really test your game properly if you dont include the image files

Author:  stickdude32 [ Mon Jan 18, 2010 9:11 am ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

put everything into one folder then compress it.

Author:  mother teresa [ Sat Feb 27, 2010 12:32 pm ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

have you figured out how your going to make the collision work? between the astroid and the ship?
because im making a car game and i need to know how to make the car collide with another object and if it does colide it recognizes that it did

Author:  Zren [ Sat Feb 27, 2010 1:18 pm ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

Dear Holy Mother,
How are your objects set up? Are they set up as classes, records, or several arrays of variables?

Is the car you control inside the array with all the other cars?

Anyways, there's a few ways to do Collision Detection:

A Point inside a Box
Box Inside a Box
Distance between Points, which can lead to...
Distance between Circles

I'm guessing you'll want to do Box inside a Box. However, do your cars rotate?

Author:  mother teresa [ Sun Feb 28, 2010 12:33 am ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

lol holy mother.... haven't heard that one yet lol.. and im still a bit of a rookie in turing so not exactly sure what your going on about...

could i email you the file with all the materials i have so far for you to take a look? and give an opinion?

Author:  Zren [ Sun Feb 28, 2010 12:51 am ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

Sure sure. My Gmail's account is ZrenFire.

Edit, or just PM it.

Author:  mother teresa [ Sun Feb 28, 2010 11:59 am ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

well i want to send the photo's as well as the music. do you have x fire? its a free simple way the send files and anything you would like between your friends

Author:  Zren [ Sun Feb 28, 2010 1:38 pm ]
Post subject:  Re: RE:Asteroid Game Asteroids!!!!!!!!!!

mother teresa @ Sun Feb 28, 2010 11:59 am wrote:
well i want to send the photo's as well as the music. do you have x fire? its a free simple way the send files and anything you would like between your friends


It's that big? I don't have XFire so, upload it to http://www.mediafire.com/ or somewhere and send me the download link.

Author:  mother teresa [ Sun Feb 28, 2010 3:14 pm ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

lol plz i hate mediafire lol
just do this http://www.xfire.com/download/now/
there IS a direct link MAKE A PROFILE which is easy then you can sent large files easy

Author:  SNIPERDUDE [ Sun Feb 28, 2010 3:57 pm ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

Now I'm considering Xfire. Using Box.net now - it's pretty good. Business-oriented.

EDIT: Sweet. mother teresa, your previous post is corrected with my greasemonkey script to properly read "please I hate mediafire" as opposed to "lol plz i hate mediafire lol".
Now just to add proper capitalization for things like the start of sentences.

Author:  mother teresa [ Sun Feb 28, 2010 8:19 pm ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

sniperdude..... its the weekend i could care less for grammar and what not lol

Author:  Zren [ Sun Feb 28, 2010 10:07 pm ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

I seriously can't believe I'm doing this. *sight* okay. zrenfire is me name.

Author:  mother teresa [ Sun Feb 28, 2010 10:47 pm ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

what>?

Author:  Zren [ Mon Mar 01, 2010 1:27 am ]
Post subject:  Re: Asteroid Game Asteroids!!!!!!!!!!

Posted Image, might have been reduced in size. Click Image to view fullscreen.

Author:  mother teresa [ Mon Mar 01, 2010 3:14 pm ]
Post subject:  RE:Asteroid Game Asteroids!!!!!!!!!!

lol


: