Computer Science Canada How my game? |
| Author: | Paper*Mate [ Thu May 26, 2005 11:38 am ] |
| Post subject: | How my game? |
What u think of my game so far?> setscreen ("offscreenonly") var x, y : int var x2, x3, y2, y3 : int := 200 var shot : boolean := false var bulletx, bullety : int := 0 x := 100 y := 100 var chars : array char of boolean loop drawfillbox (50, 110, 40, 280, black) drawfillbox (590, 110, 600, 280, black) drawfillbox (490, 0, 500, 25, black) drawfillbox (490, 375, 500, maxy, black) drawfillbox (125, 375, 135, maxy, black) drawfillbox (125, 0, 135, 25, black) drawfilloval (320, 190, 50, 50, black) drawfillbox (maxx, maxy, 637, 0, black) drawfillbox (0, 0, maxx, 2, black) drawfillbox (0, 0, 2, maxy, black) drawfillbox (0, 397, maxx, maxy, black) drawfilloval (x, y, 6, 6, 12) Input.KeyDown (chars) if chars (KEY_UP_ARROW) then if whatdotcolor (x, y + 9) = 0 then y := y + 5 end if end if if chars (KEY_RIGHT_ARROW) then if whatdotcolor (x + 9, y) = 0 then x := x + 5 end if end if if chars (KEY_LEFT_ARROW) then if whatdotcolor (x - 9, y) = 0 then x := x - 5 end if end if if chars (KEY_DOWN_ARROW) then if whatdotcolor (x, y - 9) = 0 then y := y - 5 end if end if if chars (KEY_CTRL) and shot = false then if whatdotcolor (x, y - 9) = 0 then shot := true bulletx := x + 0 bullety := y end if end if if bulletx < maxx and shot then bulletx += 8 drawfilloval (bulletx, bullety, 2, 2, brightred) elsif bulletx >= maxx then shot := false end if View.Update delay (10) cls end loop |
|
| Author: | Flikerator [ Thu May 26, 2005 1:11 pm ] |
| Post subject: | |
Good so far but next time submit as a file or put it in code tages. Also your collision is a little off. A small part of you is on the area you are moving to. You can only shoot in one direction, and only one bullet at a time. The bullet should become "false" when it hits something, or goes off the edge of the screen. If you want more then 1 bullet just use an array of a record. Read tutorials if you need help. Note - The colision is usually on diagonal collision. |
|