Computer Science Canada HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
Author: | ashlyn10 [ Mon Jan 14, 2013 11:34 pm ] |
Post subject: | HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
As much help as possible be great as this is 30% of my final mark and i dont understand this class at all, please help me!!!! % This is the background setscreen ("graphics") colourback (black) cls color (17) % This is what is on the main screen procedure mainscreen Font.Draw ("Asteriods", 10, 190, font1, white) Font.Draw ("Play Game", 230, 100, font2, white) Font.Draw ("Instructions", 230, 70, font4, white) Font.Draw ("High Scores", 230, 40, font3, white) end mainscreen procedure playgame cls end playgame % This is the instructions to the game procedure instructions cls colour (white) put "Welcome to Asteroids.The object of this game is to destroy all of the asteriods." put "while trying to avoid being hit.As you adavance to the next levels, the amount" put "of points you get for each destroyed asteroid will increase." put "Good luck,enjoy the game and have fun!" put "Controls" put "Up arrow makes you accelerate" put "Down arrow makes you decelerate" put "Left arrow makes you turn to the left" put "Right arrow makes you turn to the right" put "Space bar makes you shoot a bullet" put "Press any key to continue.." Input.Pause cls mainscreen end instructions mainscreen % If play game is selected loop Mouse.Where (mousex, mousey, button) if mousex > 230 and mousex < 350 and mousey > 100 and mousey < 125 and button = 1 then playgame elsif mousex > 230 and mousex < 350 and mousey > 70 and mousey < 95 and button = 1 then instructions end if end loop |
Author: | Panphobia [ Tue Jan 15, 2013 12:00 am ] |
Post subject: | RE:HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
what exactly do you need help with? |
Author: | Tony [ Tue Jan 15, 2013 12:38 am ] |
Post subject: | RE:HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
Moved to Turing Help. It is pretty amazing when 30% of the grade comes from a block of text describing the instructions to play a game and a loop with 5 statements inside of it. You can use a combination of Draw.Oval and Draw.Line to put together more complicated shapes... but whatever the question is, complexity of drawings is certainly not what you should be worried about. |
Author: | neuro.akn [ Tue Jan 15, 2013 12:28 pm ] |
Post subject: | RE:HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
If you want to draw your spaceship, using animations (drawfillbox, drawfilloval, etc.) will be your best bet. Just play around with the design and coordinates and such. If not, you could probably just draw a picture in "Paint" or something like that and use that drawing in your program. |
Author: | ashlyn10 [ Thu Jan 17, 2013 5:17 pm ] |
Post subject: | RE:HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
var font1 : int := Font.New ("serif:124") var font2 : int := Font.New ("serif:20") var font3 : int := Font.New ("Serif:20") var font4 : int := Font.New ("Serif:20") var mousex : int var mousey : int var button : int % This is the background setscreen ("graphics") colourback (black) cls color (17) % This is what is on the main screen procedure mainscreen Font.Draw ("Asteriods", 10, 190, font1, white) Font.Draw ("Play Game", 230, 100, font2, white) Font.Draw ("Instructions", 230, 70, font4, white) Font.Draw ("High Scores", 230, 40, font3, white) end mainscreen procedure playgame var ship : int := Pic.FileNew ("ship.gif") View.Set ("graphics:300;250),nobuttonbar") var pic : array 0 .. 35 of int const CTR : int := 48 pic (0) := ship cls for angle : 1 .. 35 pic (angle) := Pic.Rotate (pic (0), angle * 10, CTR, CTR) end for var angle : int :=0 var x : int := 300 var y : int := 300 var chars : array char of boolean loop Input.KeyDown (chars) if chars (KEY_RIGHT_ARROW) then if angle > 0 then angle := angle - 1 else angle := 35 end if end if if chars (KEY_LEFT_ARROW) then if angle < 35 then angle := angle + 1 else angle := 0 end if end if if chars (KEY_UP_ARROW) then x := x+round (2*sind(10*angle)) y := y+round (2*cosd(10*angle)) end if if chars (KEY_DOWN_ARROW) then if angle > 0 then angle := angle - 1 else angle := 35 end if end if Pic.Draw (pic (angle), x, y, picMerge) delay (50) cls end loop cls Pic.Draw (ship, 270, 160, picMerge) delay (1000) end playgame % This is the instructions to the game procedure instructions cls colour (white) put "Welcome to Asteroids.The object of this game is to destroy all of the asteriods." put "while trying to avoid being hit.As you adavance to the next levels, the amount" put "of points you get for each destroyed asteroid will increase." put "Good luck,enjoy the game and have fun!" put "Controls" put "Up arrow makes you accelerate" put "Down arrow makes you decelerate" put "Left arrow makes you turn to the left" put "Right arrow makes you turn to the right" put "Space bar makes you shoot a bullet" put "Press any key to continue.." Input.Pause cls mainscreen end instructions so this is my game so far.. how do i make asteroids, its due tomorrow so i need help asap!! mainscreen % If play game is selected loop Mouse.Where (mousex, mousey, button) if mousex > 230 and mousex < 350 and mousey > 100 and mousey < 125 and button = 1 then playgame elsif mousex > 230 and mousex < 350 and mousey > 70 and mousey < 95 and button = 1 then instructions end if end loop |
Author: | Tony [ Thu Jan 17, 2013 5:22 pm ] |
Post subject: | Re: RE:HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
ashlyn10 @ Thu Jan 17, 2013 5:17 pm wrote: so this is my game so far.. how do i make asteroids, its due tomorrow so i need help asap!!
What have you tried? Draw.Oval seems like the simplest approach. |
Author: | ashlyn10 [ Thu Jan 17, 2013 6:01 pm ] |
Post subject: | RE:HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
how would i input a picture of the asteroid into my program? |
Author: | Tony [ Thu Jan 17, 2013 6:20 pm ] |
Post subject: | RE:HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
Pic.Draw is one of the commands. The Turing Walkthrough has links to detailed tutorials on all of the subjects. |
Author: | ashlyn10 [ Fri Jan 18, 2013 3:47 pm ] |
Post subject: | Re: HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
what about making the spaceship shoot a mistle? |
Author: | Panphobia [ Fri Jan 18, 2013 3:57 pm ] |
Post subject: | RE:HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
Missile* and you would just need to animate a little mini box so thin it looks like a laser or something, and make it move in the direction you pointed it at, alternatively you could just import a picture of a missile and do the same thing, this game is actually what I did for my grade 11 summative, though I did it in java |
Author: | ashlyn10 [ Fri Jan 18, 2013 11:03 pm ] |
Post subject: | RE:HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
so how exactly do that? this is my grade 11 summitave and i do not really understand the class at all. This is my game so far, how do i make the ship shoot a mistle at the asteroiods? help please!! var font1 : int := Font.New ("serif:124") var font2 : int := Font.New ("serif:20") var font3 : int := Font.New ("Serif:20") var font4 : int := Font.New ("Serif:20") var mousex : int var mousey : int var button : int var asteroid : int := Pic.FileNew("asteroid.jpg") var asteroid3 : int := Pic.FileNew("asteroid3.jpg") % This is the background setscreen ("graphics") colourback (black) cls color (17) % This is what is on the main screen procedure mainscreen Font.Draw ("Asteriods", 10, 190, font1, white) Font.Draw ("Play Game", 230, 100, font2, white) Font.Draw ("Instructions", 230, 70, font4, white) Font.Draw ("High Scores", 230, 40, font3, white) end mainscreen procedure playgame var ship : int := Pic.FileNew ("ship.gif") View.Set ("graphics:300;250),nobuttonbar") var pic : array 0 .. 35 of int const CTR : int := 48 pic (0) := ship cls for angle : 1 .. 35 pic (angle) := Pic.Rotate (pic (0), angle * 10, CTR, CTR) end for var angle : int :=0 var x : int := 300 var y : int := 300 var chars : array char of boolean loop Input.KeyDown (chars) if chars (KEY_RIGHT_ARROW) then if angle > 0 then angle := angle - 1 else angle := 35 end if end if if chars (KEY_LEFT_ARROW) then if angle < 35 then angle := angle + 1 else angle := 0 end if end if if chars (KEY_UP_ARROW) then x := x+round (2*sind(10*angle)) y := y+round (2*cosd(10*angle)) end if if chars (KEY_DOWN_ARROW) then if angle > 0 then angle := angle - 1 else angle := 35 end if end if Pic.Draw (pic (angle), x, y, picMerge) Pic.Draw (asteroid, 30, 40, picMerge) Pic.Draw (asteroid3,420, 90, picMerge) Pic.Draw (asteroid,120, 336, picMerge) delay (50) cls end loop cls Pic.Draw (ship, 270, 160, picMerge) delay (1000) end playgame % This is the instructions to the game procedure instructions cls colour (white) put "Welcome to Asteroids.The object of this game is to destroy all of the asteriods." put "while trying to avoid being hit.As you adavance to the next levels, the amount" put "of points you get for each destroyed asteroid will increase." put "Good luck,enjoy the game and have fun!" put "Controls" put "Up arrow makes you accelerate" put "Down arrow makes you decelerate" put "Left arrow makes you turn to the left" put "Right arrow makes you turn to the right" put "Space bar makes you shoot a bullet" put "Press any key to continue.." Input.Pause cls mainscreen end instructions mainscreen % If play game is selected loop Mouse.Where (mousex, mousey, button) if mousex > 230 and mousex < 350 and mousey > 100 and mousey < 125 and button = 1 then playgame elsif mousex > 230 and mousex < 350 and mousey > 70 and mousey < 95 and button = 1 then instructions end if end loop |
Author: | evildaddy911 [ Sat Jan 19, 2013 10:03 am ] | ||
Post subject: | RE:HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap | ||
You need the angle the missile is shooting at and the velocity (per frame). Then do some basic trig to determine how many pixels up and right to move it each frame. Two other things: 1)--when posting code, use tags:
2)--if you want to post a big program (~100+ lines), attach the file instead; theres a section at the bottom of the posting screen |
Author: | Panphobia [ Sat Jan 19, 2013 12:18 pm ] |
Post subject: | RE:HOW DO YOU MAKE THE SPACESHIP FOR THE GAME ASTEROIDS? my game is due Friday help asap |
Or alternatively if you're lazy you could make the ship only be able to move up left right, and only in one direction and make the asteroids only come from one direction |