Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 2D shooter game
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: Tue Apr 01, 2003 4:41 pm   Post subject: 2D shooter game

this is a 2d shooter game that i made in 2 days. it's kinda crappy cuz i didnt have time to finish it Sad but i thought it was worth uploading it =).
read the rulez first
change the options
(when you use arrow buttons notice the legs moving it's like the guy is walking)

MOD EDIT: intresting game, i like the mian menu and jumping efect. nice animation to, 15 Bits for you.-Dan



astronaut.zip
 Description:

Download
 Filename:  astronaut.zip
 Filesize:  275.47 KB
 Downloaded:  1148 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Apr 01, 2003 5:10 pm   Post subject: (No subject)

the only thing this shooter game lacks is actual shooting Confused

I'm very confused.

Also I didnt really enjoy not being able to close the program. That sucks. Dont do it in games, plz.

If you gonna play this game - remember 3 magic keys Ctral+Alt+Del
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Homer_simpson




PostPosted: Tue Apr 01, 2003 5:54 pm   Post subject: Sorry

lol
Sorry it is not clearly explained in the rulez but here are the ke that you use
press escape during the game to exit
you can also use the exit in the menu to quit the program
use W controls to use your jetpack
A S D
use your arrow buttons to walk(walking on the space ?!!!!! lol yeah well this game wasn't even supposed to look like this)

use F to fire

and up arrow to jump
that's about it =)
Homer_simpson




PostPosted: Fri Apr 25, 2003 10:47 pm   Post subject: (No subject)

code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%                       Program name: protector astronut
%                       Author :Nima.A
%                       Teacher:Mr Noman(peace a shit)
%                       Date:Feb.25,2003
%                       Purpose :2D Shooting game
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
var bfont : int := Font.New ("System:12")
View.Set ("offscreenonly")
randomize;
var brspeed, blspeed, brnumber : int := 1

procedure button (x1, y1, x2, y2, c, tc : int, s : string, md : boolean)

    if md then
        drawline (x1, y1, x2, y1, 30)
        drawline (x2, y1, x2, y2, 30)
        drawline (x2, y2, x1, y2, 25)
        drawline (x1, y2, x1, y1, 25)
        drawfillbox (x1 + 1, y1 + 1, x2 - 1, y2 - 1, c)
    else
        drawline (x1, y1, x2, y1, 25)
        drawline (x2, y1, x2, y2, 25)
        drawline (x2, y2, x1, y2, 30)
        drawline (x1, y2, x1, y1, 30)
        drawfillbox (x1 + 1, y1 + 1, x2 - 1, y2 - 1, c)
    end if

    Font.Draw (s, (x1 + ((x2 - x1) div 2)) - (Font.Width (s, bfont) div 2), (y1 + ((y2 - y1) div 2)) - 4, bfont, tc)
end button
procedure button2 (x1, y1, x2, y2, c, tc : int, s : string, md : boolean)

    if md then
        drawline (x1, y1, x2, y1, 30)
        drawline (x2, y1, x2, y2, 30)
        drawline (x2, y2, x1, y2, 25)
        drawline (x1, y2, x1, y1, 25)
    else
        drawline (x1, y1, x2, y1, 25)
        drawline (x2, y1, x2, y2, 25)
        drawline (x2, y2, x1, y2, 30)
        drawline (x1, y2, x1, y1, 30)

    end if

    Font.Draw (s, (x1 + ((x2 - x1) div 2)) - (Font.Width (s, bfont) div 2), (y1 + ((y2 - y1) div 2)) - 4, bfont, tc)
end button2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure menu (num, x1, x2, y1, ksp, dsp, c1, c2 : int, s : array 1 .. 100 of string, n : int)
    var ii : int := num
    for i : 1 .. num * 10 by 10
        if (i div 10) not= n then

            button (x1, (y1 + (dsp * (i div 10))) + i, x2, y1 + ((dsp * (i div 10)) + i) + ksp, c1, 7, s (ii), false)
        else
            button (x1, (y1 + (dsp * (i div 10))) + i, x2, y1 + ((dsp * (i div 10)) + i) + ksp, c2, 14, s (ii), true)
        end if
        ii := ii - 1
    end for
end menu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure window (x1, y1, x2, y2, c1, c2 : int, s : string)
    button2 (x1, y1, x2, y2, 8, 14, "", false)
    button (x1 + 4, y2 - 5, x2 - 3, y2 - 20, c1, c2, s, true)
end window
procedure recscore (name : string, k, m, s, l : int)
    var file : int
    var t : string
    open : file, "c:/score.txt", write
    t := name + "   " + intstr (k) + "   " + intstr (m) + "   " + intstr (s) + "   " + intstr (l)
    write : file, t
    close (file)
end recscore
procedure showscore
    var file : int
    var t : string
    open : file, "c:/score.txt", read
    if file not= -10 then
        loop
            exit when eof (file)
            read : file, t
            put t
        end loop
        close (file)
    else
        cls
        put "No score has been Recorded!!!!"
        delay (1000)
        close (file)
    end if
end showscore
procedure gameoptions (var brspeed, blspeed, brnumber : int)
    colorback (7)
    color (15)
    cls
    locate (5, 20)
    put "Speed Of The Space Rocks : "
    locate (6, 20)
    put "Rocks Released At Once : "
    locate (7, 20)
    put "Bullet Speed : "
    color (29)
    locate (5, 50)
    get brspeed
    locate (6, 50)
    get brnumber
    locate (7, 50)
    get blspeed
end gameoptions
type joint :
    record
        x, y : int
    end record
type joint2 :
    record
        x, y, r : int
        d, ex : boolean
    end record

procedure assign (var j : joint, x, y : int)
    j.x := x
    j.y := y
end assign
function rectcontact (x, y, x1, y1, x2, y2 : int) : boolean
    for i : x1 .. x2
        for j : y1 .. y2
            if x = i then
                if y = j then
                    result true
                end if
            end if
        end for
    end for
    result false
end rectcontact

var bird, explosion : array 1 .. 10 of joint2
var pchar : array 1 .. 11 of joint
% s1 chest
const chest := 1
% s2 penis
const groin := 2
% s3 relbow
const relbow := 3
% s4 rhandp
const rhand := 4
% s5 lelbow
const lelbow := 5
% s6 lhand
const lhand := 6
% s7 rknee
const rknee := 7
% s8 rfoot
const rfoot := 8
% s9 lknee
const lknee := 9
% s10 lfoot
const lfoot := 10
% s11 head
const head := 11

const blhand := 2

const bhead := 1

var hight := 200

procedure jspeed (var s : real, i, ii : int)
    var x, y : real
    %s := sqrt ((i ** 2) - (ii ** 2))
    s := ((- ((ii / 10) ** 2)) + 100)
end jspeed


pchar (head).x := 20
pchar (head).y := hight + 60

pchar (chest).x := 20
pchar (chest).y := hight + 50

pchar (groin).x := 20
pchar (groin).y := hight + 20

pchar (relbow).x := 30
pchar (relbow).y := hight + 40

pchar (rhand).x := 40
pchar (rhand).y := hight + 50

pchar (lelbow).x := 10
pchar (lelbow).y := hight + 40

pchar (lhand).x := 20
pchar (lhand).y := hight + 30

pchar (rknee).x := 30
pchar (rknee).y := hight + 10

pchar (rfoot).x := 20
pchar (rfoot).y := hight

pchar (lknee).x := 10
pchar (lknee).y := hight + 10

pchar (lfoot).x := 0
pchar (lfoot).y := hight + 00

procedure cursor (xx, yy : int)
    drawline (xx - 4, yy, xx + 4, yy, 15)
    drawline (xx, yy - 4, xx, yy + 4, 15)
end cursor

colorback (7)
cls
procedure drawch (pchar : array 1 .. 11 of joint, x, y : int)
    drawfilloval (pchar (head).x + x, pchar (head).y + y, 10, 10, 1)
    drawline (pchar (head).x + x, pchar (head).y + y, pchar (chest).x + x, pchar (chest).y + y, 9)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (groin).x + x, pchar (groin).y + y, 12)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (relbow).x + x, pchar (relbow).y + y, 10)
    drawline (pchar (relbow).x + x, pchar (relbow).y + y, pchar (rhand).x + x, pchar (rhand).y + y, 10)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (lelbow).x + x, pchar (lelbow).y + y, 10)
    drawline (pchar (lelbow).x + x, pchar (lelbow).y + y, pchar (lhand).x + x, pchar (lhand).y + y, 10)
    drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (rknee).x + x, pchar (rknee).y + y, 10)
    drawline (pchar (rknee).x + x, pchar (rknee).y + y, pchar (rfoot).x + x, pchar (rfoot).y + y, 10)
    drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (lknee).x + x, pchar (lknee).y + y, 10)
    drawline (pchar (lknee).x + x, pchar (lknee).y + y, pchar (lfoot).x + x, pchar (lfoot).y + y, 10)
    View.Update
end drawch


procedure cleanch (pchar : array 1 .. 11 of joint, x, y : int)
    drawfilloval (pchar (head).x + x, pchar (head).y + y, 10, 10, 7)
    drawline (pchar (head).x + x, pchar (head).y + y, pchar (chest).x + x, pchar (chest).y + y, 7)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (groin).x + x, pchar (groin).y + y, 7)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (relbow).x + x, pchar (relbow).y + y, 7)
    drawline (pchar (relbow).x + x, pchar (relbow).y + y, pchar (rhand).x + x, pchar (rhand).y + y, 7)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (lelbow).x + x, pchar (lelbow).y + y, 7)
    drawline (pchar (lelbow).x + x, pchar (lelbow).y + y, pchar (lhand).x + x, pchar (lhand).y + y, 7)
    drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (rknee).x + x, pchar (rknee).y + y, 7)
    drawline (pchar (rknee).x + x, pchar (rknee).y + y, pchar (rfoot).x + x, pchar (rfoot).y + y, 7)
    drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (lknee).x + x, pchar (lknee).y + y, 7)
    drawline (pchar (lknee).x + x, pchar (lknee).y + y, pchar (lfoot).x + x, pchar (lfoot).y + y, 7)
    View.Update
end cleanch


var x1, x2, x3, x4, y1, y2, y3, y4 : int
x1 := 30
x2 := 10
x3 := 20
x4 := 0
procedure walkch (var pchar : array 1 .. 11 of joint, i : int)

    if x1 not= pchar (groin).x - 10 then
        x1 := x1 - 1
    end if
    if x2 not= pchar (groin).x + 10 then
        x2 := x2 + 1
    end if
    if x3 not= pchar (groin).x - 20 then
        x3 := x3 - 1
    end if
    if x4 not= pchar (groin).x then
        x4 := x4 + 1
    end if
    if i = 20 then
        pchar (rknee).x := 30
        pchar (rfoot).x := 10
        pchar (lknee).x := 20
        pchar (lfoot).x := 0
        x1 := 30
        x2 := 10
        x3 := 20
        x4 := 0
    end if
    assign (pchar (rknee), x1, pchar (groin).y - 10)
    assign (pchar (lknee), x2, pchar (groin).y - 10)
    assign (pchar (rfoot), x3, pchar (groin).y - 20)
    assign (pchar (lfoot), x4, pchar (groin).y - 20)
end walkch


procedure counter (var i : int, m, b : int)
    if i not= m then
        i := i + b
    else
        i := 1
    end if
end counter
var ww, misses : int := 0
var y : real := 0
var bfire : array 1 .. 10 of boolean
var bjump : boolean := false
var bullet : array 1 .. 10 of joint
var i := 0
var xx, yy := 10
var ch : char
var fff := 1
var jjj := -100
for ii : 1 .. 10
    bullet (ii).x := 1
    bullet (ii).y := 300
end for
for ii : 1 .. 10
    bfire (ii) := false
end for
procedure pbullet (var bullet : array 1 .. 10 of joint, xxx : int)
    if bullet (xxx).x <= 600 then
        bullet (xxx).x := bullet (xxx).x + blspeed
    else
        bfire (xxx) := false
    end if
end pbullet


procedure drawbullet (var bullet : joint, var bfire : array 1 .. 10 of boolean, ii : int)
    drawfilloval (bullet.x, bullet.y, 6, 2, 8)
    View.Update
end drawbullet


procedure cleanbullet (var bullet : joint, var bfire : array 1 .. 10 of boolean, ii : int)
    drawfilloval (bullet.x, bullet.y, 6, 2, 7)
    View.Update
end cleanbullet

procedure line (x1, y1, x2, y2 : int, x : real, var y : int)
    var m : real
    if x2 not= x1 then
        m := ((y2 - y1) / (x2 - x1))
    end if
    y := round (m * x)
end line

for kj : 1 .. 10
    bird (kj).x := 490 + (kj * 10)
    bird (kj).y := 100 + (kj * 20)
    bird (kj).d := false
    bird (kj).ex := false
    bird (kj).r := 0
    explosion (kj).x := 490 + (kj * 10)
    explosion (kj).y := 100 + (kj * 20)
    explosion (kj).d := false
    explosion (kj).ex := false
end for


procedure birdmove (var bird : joint2, pchar : array 1 .. 11 of joint, var x : real, xx, yy : int)
    if bird.d then
        var x2 := pchar (head).x + xx
        var y2 := pchar (head).y + yy
        if bird.x > 0 then
            bird.x := bird.x - brspeed
        end if
        if bird.x <= 1 then
            misses := misses + 1
            bird.ex := true
            bird.d := false
        end if
        if bird.y > y2 then
            bird.y := round (bird.y - 1)
        end if
        if bird.y < bird.r then
            bird.y := round (bird.y + .5)
        end if
    end if
end birdmove
procedure drawbird (bird : joint2)
    var i1, i2, i3, i4, i5 : int
    var r1, r2, r3, r4 : int
    if bird.d then
        randint (r1, 1, 5)
        randint (r2, 1, 5)
        randint (r3, 1, 5)
        randint (r4, 1, 5)
        randint (i1, 1, 255)
        randint (i2, 1, 255)
        randint (i3, 1, 255)
        randint (i4, 1, 255)
        randint (i5, 1, 255)
        drawfilloval (bird.x, bird.y, 10, 10, i1)
        drawfilloval (bird.x - 5, bird.y, r1, r4, i2)
        drawfilloval (bird.x + 5, bird.y, r2, r3, i3)
        drawfilloval (bird.x, bird.y - 5, r3, r2, i4)
        drawfilloval (bird.x, bird.y + 5, r4, r1, i5)
        drawline (bird.x, bird.y - 10, bird.x, bird.y + 10, i1)
        drawline (bird.x - 10, bird.y, bird.x + 10, bird.y, i1)
        View.Update
    end if
end drawbird
procedure cleanbird (bird : joint2)
    if bird.d then
        drawfilloval (bird.x, bird.y, 11, 11, 7)
    end if
    View.Update
end cleanbird
procedure drawex (var bird : joint2, x, y, i : int)
    drawoval (x, y, i, i, i)
    drawoval (x, y, 10 - i, i, i)
    drawoval (x, y, i, 10 - i, i)
    if i = 20 then
        drawfilloval (x, y, i, i, 16)
        bird.ex := false
    end if
    View.Update
end drawex
procedure createn (var bird : array 1 .. 10 of joint2, h : int)
    var hh, x, y : int := 0
    var b : boolean := false
    for i : 1 .. 10
        if bird (i).d then
            hh := hh + 1
        end if
    end for
    if hh < h then
        for i : 1 .. 10
            if not bird (i).d then
                bird (i).d := true
                randint (x, 1, 100)
                randint (y, 1, 160)
                bird (i).x := 400 + x
                bird (i).y := 260 + y
                randint (bird (i).r, 0, 400)
                exit
            end if
        end for
    end if
    View.Update
end createn
procedure background (x1, y1 : int)
    drawfillstar (x1 + 220, y1 + 170, x1 + 230, 180 + y1, 8)
    drawfillstar (x1 + 390, y1 + 200, x1 + 400, 210 + y1, 8)
    drawfillstar (x1 + 430, y1 + 260, x1 + 440, 270 + y1, 8)
    drawfillstar (x1 + 520, y1 + 150, x1 + 530, 140 + y1, 8)
    drawfillstar (x1 + 360, y1 + 130, x1 + 350, 140 + y1, 8)
    drawfillstar (x1 + 90, y1 + 120, x1 + 80, 110 + y1, 8)
    drawfillstar (x1 + 80, y1 + 270, x1 + 90, 280 + y1, 8)
    drawfillstar (x1 + 240, y1 + 290, x1 + 250, 300 + y1, 8)
    drawfillstar (x1 + 470, y1 + 350, x1 + 480, 340 + y1, 8)
    drawfillstar (x1 + 560, y1 + 300, x1 + 570, 290 + y1, 8)
    drawfillstar (x1 + 290, y1 + 240, x1 + 300, 230 + y1, 8)
    drawfillstar (x1 + 130, y1 + 380, x1 + 140, 370 + y1, 8)
    drawfillstar (x1 + 140, y1 + 90, x1 + 150, 80 + y1, 8)
    drawfillstar (x1 + 420, y1 + 70, x1 + 430, 60 + y1, 8)
    drawfillstar (x1 + 610, y1 + 40, x1 + 620, 30 + y1, 8)
    drawfillstar (x1 + 340, y1 + 30, x1 + 320, 50 + y1, 11)
    drawfillstar (x1 + 30, y1 + 190, x1 + 50, 210 + y1, 11)
    drawfillstar (x1 + 540, y1 + 210, x1 + 560, 240 + y1, 11)
    drawfillstar (x1 + 570, y1 + 330, x1 + 590, 350 + y1, 11)
    drawfillstar (x1 + 380, y1 + 350, x1 + 360, 370 + y1, 11)
    drawfillstar (x1 + 310, y1 + 140, x1 + 280, 170 + y1, 11)
    drawfillstar (x1 + 180, y1 + 230, x1 + 160, 250 + y1, 11)
    drawfillstar (x1 + 70, y1 + 330, x1 + 90, 310 + y1, 11)
    drawfillstar (x1 + 330, y1 + 310, x1 + 310, 330 + y1, 11)
    drawfillstar (x1 + 510, y1 + 60, x1 + 540, 40 + y1, 11)
    View.Update
end background

var bbi := .1
var brx, bry := 200
var mmm, num, menunum := 1
var back, bmissed : boolean := false
var bx1, bx2, by1, by2 : real := 0
bird (1).d := true
var yy2, shots, kills, missed := 0
var name : string
var level := 1
var menus : array 1 .. 100 of string
menus (1) := "Start Game"
menus (2) := "Game Options"
menus (3) := "Game Rulez"
menus (4) := "Show last Scores"
menus (5) := "Exit"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure startgame
        color (7)
    locate (4, 10)
    put "Please enter your name : "
    locate (4, 35)
    get name
    colorback (7)

    loop
        createn (bird, brnumber)
        % LOCATING SECTION      LOCATING SECTION      LOCATING SECTION      LOCATING SECTION
        for ii : 1 .. 10
            if bfire (ii) then
                pbullet (bullet, ii)
            end if
        end for
        if bjump then
            jspeed (y, 100, jjj)
            counter (jjj, 100, 3)
            if back then
                xx := xx - 1
            else
                xx := xx + 1
            end if
            if jjj >= 100 then
                bjump := false
                jjj := -100
            end if

        end if
        color (15)
        for ii : 1 .. 10
            if bird (ii).d then
                birdmove (bird (ii), pchar, bbi, xx, round (y))
            end if
        end for
        bbi := bbi + 1
        % DRAWING SECTION     DRAWING SECTION     DRAWING SECTION     DRAWING SECTION
        for jj : 1 .. 10
            if bfire (jj) then
                for ii : 1 .. 10
                    if bird (ii).d then
                        if rectcontact (bullet (jj).x, bullet (jj).y, bird (ii).x - 10, bird (ii).y - 10, bird (ii).x + 10, bird (ii).y + 10) then
                            if (kills + 1) mod 50 = 0 then
                                locate (6, 35)
                                put "You have advanced to the next level !!!!!"
                                locate (6, 35)
                                brspeed := brspeed + 1
                                brnumber := brnumber + 1
                                put " Press any key to continue .  .  .  .  "
                                loop
                                    exit when hasch
                                end loop
                            end if
                            kills := kills + 1
                            bfire (jj) := false
                            bird (ii).d := false
                            bird (ii).ex := true
                        end if
                    end if
                end for
            end if
        end for
        for ii : 1 .. 10
            if bird (ii).ex then
                explosion (ii).d := true
                explosion (ii).ex := true
                explosion (ii).x := bird (ii).x
                explosion (ii).y := bird (ii).y
                bird (ii).ex := false
            end if
        end for
        for ii : 1 .. 10
            if explosion (ii).ex then
                counter (mmm, 20, 1)
                drawex (explosion (ii), explosion (ii).x, explosion (ii).y, mmm)
            end if
        end for
        for ii : 1 .. 10
            if bfire (ii) then
                drawbullet (bullet (ii), bfire, ii)
            end if
        end for
        drawch (pchar, xx, round (y))
        for ii : 1 .. 10
            if bird (ii).d then
                drawbird (bird (ii))
            end if
        end for
                % CLEANING SECTION CLEANING SECTION   CLEANING SECTION   CLEANING SECTION
        delay (20)
        for ii : 1 .. 10
            if bfire (ii) then
                cleanbullet (bullet (ii), bfire, ii)
            else
                bullet (ii).x := xx
            end if
        end for
        cleanch (pchar, xx, round (y))
        for ii : 1 .. 10
            if bird (ii).d then
                cleanbird (bird (ii))
            end if
        end for
        if hasch then
            ch := getchar
            case ch of
                label "d" :
                    counter (ww, 20, 1)
                    back := false
                    if not bjump then
                        walkch (pchar, ww)
                        xx := xx + 3
                    else
                        xx := xx + 2
                    end if
                label "a" :
                    counter (ww, 20, 1)
                    back := true
                    if not bjump then
                        walkch (pchar, ww)
                        xx := xx - 3
                    else
                        xx := xx - 2
                    end if
                label "f" :
                    shots := shots + 1
                    bfire (fff) := true
                    bullet (fff).x := xx + 30
                    counter (fff, 9, 1)
                    bullet (fff).y := round (y) + pchar (head).y
                label "w" :
                    bjump := true
                label chr (27) :
                    colorback (8)
                    cls
                    window (100, 100, 530, 290, 9, 14, "Score")
                    button2 (105, 105, 525, 265, 8, 14, "", true)
                    color (7)
                    locate (10, 15)
                    put "Kills  : ", kills
                    locate (11, 15)
                    put "misses : ", misses
                    locate (12, 15)
                    put "Shots  : ", shots
                    locate (13, 15)
                    level := round ((brspeed * brnumber) / blspeed)
                    put "Level  : ", level
                    recscore (name, kills, misses, shots, level)
                    window (100, 100, 530, 290, 9, 14, "Score")
                    button2 (105, 105, 525, 265, 8, 14, "", true)
                    loop
                        exit when hasch
                    end loop
                    exit
                label chr (208) :
                    for ii : 1 .. 10
                        bird (ii).y := bird (ii).y + 3
                        bullet (ii).y := bullet (ii).y + 3
                        by1 := by1 + .1

                    end for
                label chr (200) :
                    for ii : 1 .. 10
                        bird (ii).y := bird (ii).y - 3
                        bullet (ii).y := bullet (ii).y - 3
                        by1 := by1 - .1

                    end for
                label :
            end case
        end if     %Hasch
       
        cls
        background (round (bx1), round (by1))
        background (round (bx1), round (by1) + 400)
        background (round (bx1), round (by1) - 400)

    end loop
end startgame
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%menu (num, x1, x2, y1, ksp, dsp, c1, c2 : int, s : array 1 .. 100 of string, n : int)


%menu (10, 220, 420, 10, 20, 20, 8, 1, menus, i)
procedure gamerules
    color (7)
    window (10, 10, 630, 390, 9, 14, "Game Rules")
    locate (4, 4)
    put "This a simple 2D shooting game. Your character is an astronut"
    locate (5, 4)
    put "who is equiped with a jetpack and a gun and he's trying to protect "
    locate (6, 4)
    put "his ship from flying aerolite by blowing them off the space."
    locate (7, 4)
    put "Controls :"
    locate (8, 4)
    put "d     --> Walk forward"
    locate (9, 4)
    put "a     --> Walk backward"
    locate (10, 4)
    put "w     --> Jump"
    locate (11, 4)
    put "Up    --> Move up"
    locate (12, 4)
    put "Down  --> Move down"
    locate (13, 4)
    put "Esc   --> Exit"
    locate (17, 10)
    put "           Press anykey to return to main menu . . ."
    window (10, 10, 630, 390, 9, 14, "Game Rules")
    loop
        exit when hasch
    end loop
end gamerules
colorback (8)
cls
menunum := 4
window (200, 50, 440, 300, 9, 14, "Main Menu")
menu (5, 220, 420, 100, 20, 20, 8, 9, menus, menunum)
color (14)
loop
    if hasch then
        window (200, 50, 440, 300, 9, 14, "Main Menu")
        case getchar of
            label chr (200) :
                if menunum < 4 then
                    menunum := menunum + 1
                end if
            label chr (208) :
                if menunum > 0 then
                    menunum := menunum - 1
                end if
            label chr (10) :
                put menunum
                case menunum of
                    label 4 :
                        cls
                        startgame
                        colorback (8)
                        cls
                        window (200, 50, 440, 300, 9, 14, "Main Menu")
                    label 3 :
                        cls
                        gameoptions (brspeed, blspeed, brnumber)
                        colorback (8)
                        cls
                        window (200, 50, 440, 300, 9, 14, "Main Menu")
                    label 2 :
                        cls
                        gamerules
                        colorback (8)
                        cls
                        window (200, 50, 440, 300, 9, 14, "Main Menu")
                    label 1 :
                        colorback (7)
                        cls
                        showscore
                        put "press any key to continue..."
                        loop
                            exit when hasch
                        end loop
                        colorback (8)
                        cls
                    label 0 :
                        exit
                    label :
                end case
            label :
        end case
        menu (5, 220, 420, 100, 20, 20, 8, 9, menus, menunum)
    end if
end loop
%gameoptions (brspeed, blspeed, brnumber)

here's the code hope it helps u make yer own even tho i haven't used View.Update in it
Homer_simpson




PostPosted: Fri Apr 25, 2003 10:57 pm   Post subject: (No subject)

And here's the one in which i uses View.Update
code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
%                       Program name: protector astronut
%                       Author :Nima.A
%                       Teacher:Mr Noman(peace a shit)
%                       Date:Feb.25,2003
%                       Purpose :2D Shooting game
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
var bfont : int := Font.New ("System:12")
randomize;
var brspeed, blspeed, brnumber : int := 1

procedure button (x1, y1, x2, y2, c, tc : int, s : string, md : boolean)

    if md then
        drawline (x1, y1, x2, y1, 30)
        drawline (x2, y1, x2, y2, 30)
        drawline (x2, y2, x1, y2, 25)
        drawline (x1, y2, x1, y1, 25)
        drawfillbox (x1 + 1, y1 + 1, x2 - 1, y2 - 1, c)
    else
        drawline (x1, y1, x2, y1, 25)
        drawline (x2, y1, x2, y2, 25)
        drawline (x2, y2, x1, y2, 30)
        drawline (x1, y2, x1, y1, 30)
        drawfillbox (x1 + 1, y1 + 1, x2 - 1, y2 - 1, c)
    end if

    Font.Draw (s, (x1 + ((x2 - x1) div 2)) - (Font.Width (s, bfont) div 2), (y1 + ((y2 - y1) div 2)) - 4, bfont, tc)
end button
procedure button2 (x1, y1, x2, y2, c, tc : int, s : string, md : boolean)

    if md then
        drawline (x1, y1, x2, y1, 30)
        drawline (x2, y1, x2, y2, 30)
        drawline (x2, y2, x1, y2, 25)
        drawline (x1, y2, x1, y1, 25)
    else
        drawline (x1, y1, x2, y1, 25)
        drawline (x2, y1, x2, y2, 25)
        drawline (x2, y2, x1, y2, 30)
        drawline (x1, y2, x1, y1, 30)

    end if

    Font.Draw (s, (x1 + ((x2 - x1) div 2)) - (Font.Width (s, bfont) div 2), (y1 + ((y2 - y1) div 2)) - 4, bfont, tc)
end button2
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure menu (num, x1, x2, y1, ksp, dsp, c1, c2 : int, s : array 1 .. 100 of string, n : int)
    var ii : int := num
    for i : 1 .. num * 10 by 10
        if (i div 10) not= n then

            button (x1, (y1 + (dsp * (i div 10))) + i, x2, y1 + ((dsp * (i div 10)) + i) + ksp, c1, 7, s (ii), false)
        else
            button (x1, (y1 + (dsp * (i div 10))) + i, x2, y1 + ((dsp * (i div 10)) + i) + ksp, c2, 14, s (ii), true)
        end if
        ii := ii - 1
    end for
end menu
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure window (x1, y1, x2, y2, c1, c2 : int, s : string)
    button2 (x1, y1, x2, y2, 8, 14, "", false)
    button (x1 + 4, y2 - 5, x2 - 3, y2 - 20, c1, c2, s, true)
end window
procedure recscore (name : string, k, m, s, l : int)
    var file : int
    var t : string
    open : file, "c:/score.txt", write
    t := name + "   " + intstr (k) + "   " + intstr (m) + "   " + intstr (s) + "   " + intstr (l)
    write : file, t
    close (file)
end recscore
procedure showscore
    var file : int
    var t : string
    open : file, "c:/score.txt", read
    if file not= -10 then
        loop
            exit when eof (file)
            read : file, t
            put t
        end loop
        close (file)
    else
        cls
        put "No score has been Recorded!!!!"
        delay (1000)
        close (file)
    end if
end showscore
procedure gameoptions (var brspeed, blspeed, brnumber : int)
    colorback (7)
    color (15)
    cls
    locate (5, 20)
    put "Speed Of The Space Rocks : "
    locate (6, 20)
    put "Rocks Released At Once : "
    locate (7, 20)
    put "Bullet Speed : "
    color (29)
    locate (5, 50)
    get brspeed
    locate (6, 50)
    get brnumber
    locate (7, 50)
    get blspeed
end gameoptions
type joint :
    record
        x, y : int
    end record
type joint2 :
    record
        x, y, r : int
        d, ex : boolean
    end record

procedure assign (var j : joint, x, y : int)
    j.x := x
    j.y := y
end assign
function rectcontact (x, y, x1, y1, x2, y2 : int) : boolean
    for i : x1 .. x2
        for j : y1 .. y2
            if x = i then
                if y = j then
                    result true
                end if
            end if
        end for
    end for
    result false
end rectcontact

var bird, explosion : array 1 .. 10 of joint2
var pchar : array 1 .. 11 of joint
% s1 chest
const chest := 1
% s2 penis
const groin := 2
% s3 relbow
const relbow := 3
% s4 rhandp
const rhand := 4
% s5 lelbow
const lelbow := 5
% s6 lhand
const lhand := 6
% s7 rknee
const rknee := 7
% s8 rfoot
const rfoot := 8
% s9 lknee
const lknee := 9
% s10 lfoot
const lfoot := 10
% s11 head
const head := 11

const blhand := 2

const bhead := 1

var hight := 200

procedure jspeed (var s : real, i, ii : int)
    var x, y : real
    %s := sqrt ((i ** 2) - (ii ** 2))
    s := ((- ((ii / 10) ** 2)) + 100)
end jspeed


pchar (head).x := 20
pchar (head).y := hight + 60

pchar (chest).x := 20
pchar (chest).y := hight + 50

pchar (groin).x := 20
pchar (groin).y := hight + 20

pchar (relbow).x := 30
pchar (relbow).y := hight + 40

pchar (rhand).x := 40
pchar (rhand).y := hight + 50

pchar (lelbow).x := 10
pchar (lelbow).y := hight + 40

pchar (lhand).x := 20
pchar (lhand).y := hight + 30

pchar (rknee).x := 30
pchar (rknee).y := hight + 10

pchar (rfoot).x := 20
pchar (rfoot).y := hight

pchar (lknee).x := 10
pchar (lknee).y := hight + 10

pchar (lfoot).x := 0
pchar (lfoot).y := hight + 00

procedure cursor (xx, yy : int)
    drawline (xx - 4, yy, xx + 4, yy, 15)
    drawline (xx, yy - 4, xx, yy + 4, 15)
end cursor

colorback (7)
cls
procedure drawch (pchar : array 1 .. 11 of joint, x, y : int)
    drawfilloval (pchar (head).x + x, pchar (head).y + y, 10, 10, 1)
    drawline (pchar (head).x + x, pchar (head).y + y, pchar (chest).x + x, pchar (chest).y + y, 9)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (groin).x + x, pchar (groin).y + y, 12)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (relbow).x + x, pchar (relbow).y + y, 10)
    drawline (pchar (relbow).x + x, pchar (relbow).y + y, pchar (rhand).x + x, pchar (rhand).y + y, 10)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (lelbow).x + x, pchar (lelbow).y + y, 10)
    drawline (pchar (lelbow).x + x, pchar (lelbow).y + y, pchar (lhand).x + x, pchar (lhand).y + y, 10)
    drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (rknee).x + x, pchar (rknee).y + y, 10)
    drawline (pchar (rknee).x + x, pchar (rknee).y + y, pchar (rfoot).x + x, pchar (rfoot).y + y, 10)
    drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (lknee).x + x, pchar (lknee).y + y, 10)
    drawline (pchar (lknee).x + x, pchar (lknee).y + y, pchar (lfoot).x + x, pchar (lfoot).y + y, 10)
end drawch


procedure cleanch (pchar : array 1 .. 11 of joint, x, y : int)
    drawfilloval (pchar (head).x + x, pchar (head).y + y, 10, 10, 7)
    drawline (pchar (head).x + x, pchar (head).y + y, pchar (chest).x + x, pchar (chest).y + y, 7)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (groin).x + x, pchar (groin).y + y, 7)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (relbow).x + x, pchar (relbow).y + y, 7)
    drawline (pchar (relbow).x + x, pchar (relbow).y + y, pchar (rhand).x + x, pchar (rhand).y + y, 7)
    drawline (pchar (chest).x + x, pchar (chest).y + y, pchar (lelbow).x + x, pchar (lelbow).y + y, 7)
    drawline (pchar (lelbow).x + x, pchar (lelbow).y + y, pchar (lhand).x + x, pchar (lhand).y + y, 7)
    drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (rknee).x + x, pchar (rknee).y + y, 7)
    drawline (pchar (rknee).x + x, pchar (rknee).y + y, pchar (rfoot).x + x, pchar (rfoot).y + y, 7)
    drawline (pchar (groin).x + x, pchar (groin).y + y, pchar (lknee).x + x, pchar (lknee).y + y, 7)
    drawline (pchar (lknee).x + x, pchar (lknee).y + y, pchar (lfoot).x + x, pchar (lfoot).y + y, 7)
end cleanch


var x1, x2, x3, x4, y1, y2, y3, y4 : int
x1 := 30
x2 := 10
x3 := 20
x4 := 0
procedure walkch (var pchar : array 1 .. 11 of joint, i : int)

    if x1 not= pchar (groin).x - 10 then
        x1 := x1 - 1
    end if
    if x2 not= pchar (groin).x + 10 then
        x2 := x2 + 1
    end if
    if x3 not= pchar (groin).x - 20 then
        x3 := x3 - 1
    end if
    if x4 not= pchar (groin).x then
        x4 := x4 + 1
    end if
    if i = 20 then
        pchar (rknee).x := 30
        pchar (rfoot).x := 10
        pchar (lknee).x := 20
        pchar (lfoot).x := 0
        x1 := 30
        x2 := 10
        x3 := 20
        x4 := 0
    end if
    assign (pchar (rknee), x1, pchar (groin).y - 10)
    assign (pchar (lknee), x2, pchar (groin).y - 10)
    assign (pchar (rfoot), x3, pchar (groin).y - 20)
    assign (pchar (lfoot), x4, pchar (groin).y - 20)
end walkch


procedure counter (var i : int, m, b : int)
    if i not= m then
        i := i + b
    else
        i := 1
    end if
end counter
var ww, misses : int := 0
var y : real := 0
var bfire : array 1 .. 10 of boolean
var bjump : boolean := false
var bullet : array 1 .. 10 of joint
var i := 0
var xx, yy := 10
var ch : char
var fff := 1
var jjj := -100
for ii : 1 .. 10
    bullet (ii).x := 1
    bullet (ii).y := 300
end for
for ii : 1 .. 10
    bfire (ii) := false
end for
procedure pbullet (var bullet : array 1 .. 10 of joint, xxx : int)
    if bullet (xxx).x <= 600 then
        bullet (xxx).x := bullet (xxx).x + blspeed
    else
        bfire (xxx) := false
    end if
end pbullet


procedure drawbullet (var bullet : joint, var bfire : array 1 .. 10 of boolean, ii : int)
    drawfilloval (bullet.x, bullet.y, 6, 2, 8)
end drawbullet


procedure cleanbullet (var bullet : joint, var bfire : array 1 .. 10 of boolean, ii : int)
    drawfilloval (bullet.x, bullet.y, 6, 2, 7)
end cleanbullet

procedure line (x1, y1, x2, y2 : int, x : real, var y : int)
    var m : real
    if x2 not= x1 then
        m := ((y2 - y1) / (x2 - x1))
    end if
    y := round (m * x)
end line

for kj : 1 .. 10
    bird (kj).x := 490 + (kj * 10)
    bird (kj).y := 100 + (kj * 20)
    bird (kj).d := false
    bird (kj).ex := false
    bird (kj).r := 0
    explosion (kj).x := 490 + (kj * 10)
    explosion (kj).y := 100 + (kj * 20)
    explosion (kj).d := false
    explosion (kj).ex := false
end for


procedure birdmove (var bird : joint2, pchar : array 1 .. 11 of joint, var x : real, xx, yy : int)
    if bird.d then
        var x2 := pchar (head).x + xx
        var y2 := pchar (head).y + yy
        if bird.x > 0 then
            bird.x := bird.x - brspeed
        end if
        if bird.x <= 1 then
            misses := misses + 1
            bird.ex := true
            bird.d := false
        end if
        if bird.y > y2 then
            bird.y := round (bird.y - 1)
        end if
        if bird.y < bird.r then
            bird.y := round (bird.y + .5)
        end if
    end if
end birdmove
procedure drawbird (bird : joint2)
    var i1, i2, i3, i4, i5 : int
    var r1, r2, r3, r4 : int
    if bird.d then
        randint (r1, 1, 5)
        randint (r2, 1, 5)
        randint (r3, 1, 5)
        randint (r4, 1, 5)
        randint (i1, 1, 255)
        randint (i2, 1, 255)
        randint (i3, 1, 255)
        randint (i4, 1, 255)
        randint (i5, 1, 255)
        drawfilloval (bird.x, bird.y, 10, 10, i1)
        drawfilloval (bird.x - 5, bird.y, r1, r4, i2)
        drawfilloval (bird.x + 5, bird.y, r2, r3, i3)
        drawfilloval (bird.x, bird.y - 5, r3, r2, i4)
        drawfilloval (bird.x, bird.y + 5, r4, r1, i5)
        drawline (bird.x, bird.y - 10, bird.x, bird.y + 10, i1)
        drawline (bird.x - 10, bird.y, bird.x + 10, bird.y, i1)
    end if
end drawbird
procedure cleanbird (bird : joint2)
    if bird.d then
        drawfilloval (bird.x, bird.y, 11, 11, 7)
    end if

end cleanbird
procedure drawex (var bird : joint2, x, y, i : int)
    drawoval (x, y, i, i, i)
    drawoval (x, y, 10 - i, i, i)
    drawoval (x, y, i, 10 - i, i)
    if i = 20 then
        drawfilloval (x, y, i, i, 16)
        bird.ex := false
    end if
end drawex
procedure createn (var bird : array 1 .. 10 of joint2, h : int)
    var hh, x, y : int := 0
    var b : boolean := false
    for i : 1 .. 10
        if bird (i).d then
            hh := hh + 1
        end if
    end for
    if hh < h then
        for i : 1 .. 10
            if not bird (i).d then
                bird (i).d := true
                randint (x, 1, 100)
                randint (y, 1, 160)
                bird (i).x := 400 + x
                bird (i).y := 260 + y
                randint (bird (i).r, 0, 400)
                exit
            end if
        end for
    end if
end createn
procedure background (x1, y1 : int)
    drawfillstar (x1 + 220, y1 + 170, x1 + 230, 180 + y1, 8)
    drawfillstar (x1 + 390, y1 + 200, x1 + 400, 210 + y1, 8)
    drawfillstar (x1 + 430, y1 + 260, x1 + 440, 270 + y1, 8)
    drawfillstar (x1 + 520, y1 + 150, x1 + 530, 140 + y1, 8)
    drawfillstar (x1 + 360, y1 + 130, x1 + 350, 140 + y1, 8)
    drawfillstar (x1 + 90, y1 + 120, x1 + 80, 110 + y1, 8)
    drawfillstar (x1 + 80, y1 + 270, x1 + 90, 280 + y1, 8)
    drawfillstar (x1 + 240, y1 + 290, x1 + 250, 300 + y1, 8)
    drawfillstar (x1 + 470, y1 + 350, x1 + 480, 340 + y1, 8)
    drawfillstar (x1 + 560, y1 + 300, x1 + 570, 290 + y1, 8)
    drawfillstar (x1 + 290, y1 + 240, x1 + 300, 230 + y1, 8)
    drawfillstar (x1 + 130, y1 + 380, x1 + 140, 370 + y1, 8)
    drawfillstar (x1 + 140, y1 + 90, x1 + 150, 80 + y1, 8)
    drawfillstar (x1 + 420, y1 + 70, x1 + 430, 60 + y1, 8)
    drawfillstar (x1 + 610, y1 + 40, x1 + 620, 30 + y1, 8)
    drawfillstar (x1 + 340, y1 + 30, x1 + 320, 50 + y1, 11)
    drawfillstar (x1 + 30, y1 + 190, x1 + 50, 210 + y1, 11)
    drawfillstar (x1 + 540, y1 + 210, x1 + 560, 240 + y1, 11)
    drawfillstar (x1 + 570, y1 + 330, x1 + 590, 350 + y1, 11)
    drawfillstar (x1 + 380, y1 + 350, x1 + 360, 370 + y1, 11)
    drawfillstar (x1 + 310, y1 + 140, x1 + 280, 170 + y1, 11)
    drawfillstar (x1 + 180, y1 + 230, x1 + 160, 250 + y1, 11)
    drawfillstar (x1 + 70, y1 + 330, x1 + 90, 310 + y1, 11)
    drawfillstar (x1 + 330, y1 + 310, x1 + 310, 330 + y1, 11)
    drawfillstar (x1 + 510, y1 + 60, x1 + 540, 40 + y1, 11)
end background

var bbi := .1
var brx, bry := 200
var mmm, num, menunum := 1
var back, bmissed : boolean := false
var bx1, bx2, by1, by2 : real := 0
bird (1).d := true
var yy2, shots, kills, missed := 0
var name : string
var level := 1
var menus : array 1 .. 100 of string
menus (1) := "Start Game"
menus (2) := "Game Options"
menus (3) := "Game Rulez"
menus (4) := "Show last Scores"
menus (5) := "Exit"
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
procedure startgame
    color (7)
    locate (4, 10)
    put "Please enter your name : "
    locate (4, 35)
    get name
    colorback (7)
    View.Set ("offscreenonly")
    loop
        createn (bird, brnumber)
        % LOCATING SECTION      LOCATING SECTION      LOCATING SECTION      LOCATING SECTION
        for ii : 1 .. 10
            if bfire (ii) then
                pbullet (bullet, ii)
            end if
        end for
        if bjump then
            jspeed (y, 100, jjj)
            counter (jjj, 100, 3)
            if back then
                xx := xx - 1
            else
                xx := xx + 1
            end if
            if jjj >= 100 then
                bjump := false
                jjj := -100
            end if

        end if
        color (15)
        for ii : 1 .. 10
            if bird (ii).d then
                birdmove (bird (ii), pchar, bbi, xx, round (y))
            end if
        end for
        bbi := bbi + 1
        % DRAWING SECTION     DRAWING SECTION     DRAWING SECTION     DRAWING SECTION
        for jj : 1 .. 10
            if bfire (jj) then
                for ii : 1 .. 10
                    if bird (ii).d then
                        if rectcontact (bullet (jj).x, bullet (jj).y, bird (ii).x - 10, bird (ii).y - 10, bird (ii).x + 10, bird (ii).y + 10) then
                            if (kills + 1) mod 50 = 0 then
                                locate (6, 35)
                                put "You have advanced to the next level !!!!!"
                                locate (6, 35)
                                brspeed := brspeed + 1
                                brnumber := brnumber + 1
                                put " Press any key to continue .  .  .  .  "
                                loop
                                    exit when hasch
                                end loop
                            end if
                            kills := kills + 1
                            bfire (jj) := false
                            bird (ii).d := false
                            bird (ii).ex := true
                        end if
                    end if
                end for
            end if
        end for
        for ii : 1 .. 10
            if bird (ii).ex then
                explosion (ii).d := true
                explosion (ii).ex := true
                explosion (ii).x := bird (ii).x
                explosion (ii).y := bird (ii).y
                bird (ii).ex := false
            end if
        end for
        for ii : 1 .. 10
            if explosion (ii).ex then
                counter (mmm, 20, 1)
                drawex (explosion (ii), explosion (ii).x, explosion (ii).y, mmm)
            end if
        end for
        for ii : 1 .. 10
            if bfire (ii) then
                drawbullet (bullet (ii), bfire, ii)
            end if
        end for
        drawch (pchar, xx, round (y))
        for ii : 1 .. 10
            if bird (ii).d then
                drawbird (bird (ii))
            end if
        end for
        View.Update
        % CLEANING SECTION CLEANING SECTION   CLEANING SECTION   CLEANING SECTION
        delay (20)
        cls
        /*  for ii : 1 .. 10
         if bfire (ii) then
         cleanbullet (bullet (ii), bfire, ii)
         else
         bullet (ii).x := xx
         end if
         end for
         cleanch (pchar, xx, round (y))
         for ii : 1 .. 10
         if bird (ii).d then
         cleanbird (bird (ii))
         end if
         end for*/
        if hasch then
            ch := getchar
            case ch of
                label "d" :
                    counter (ww, 20, 1)
                    back := false
                    if not bjump then
                        walkch (pchar, ww)
                        xx := xx + 3
                    else
                        xx := xx + 2
                    end if
                label "a" :
                    counter (ww, 20, 1)
                    back := true
                    if not bjump then
                        walkch (pchar, ww)
                        xx := xx - 3
                    else
                        xx := xx - 2
                    end if
                label "f" :
                    shots := shots + 1
                    bfire (fff) := true
                    bullet (fff).x := xx + 30
                    counter (fff, 9, 1)
                    bullet (fff).y := round (y) + pchar (head).y
                label "w" :
                    bjump := true
                label chr (27) :
                    View.Set ("nooffscreenonly")
                    colorback (8)
                    cls
                    window (100, 100, 530, 290, 9, 14, "Score")
                    button2 (105, 105, 525, 265, 8, 14, "", true)
                    color (7)
                    locate (10, 15)
                    put "Kills  : ", kills
                    locate (11, 15)
                    put "misses : ", misses
                    locate (12, 15)
                    put "Shots  : ", shots
                    locate (13, 15)
                    level := round ((brspeed * brnumber) / blspeed)
                    put "Level  : ", level
                    recscore (name, kills, misses, shots, level)
                    window (100, 100, 530, 290, 9, 14, "Score")
                    button2 (105, 105, 525, 265, 8, 14, "", true)
                    loop
                        exit when hasch
                    end loop
                    exit
                label chr (208) :
                    for ii : 1 .. 10
                        bird (ii).y := bird (ii).y + 3
                        bullet (ii).y := bullet (ii).y + 3
                        by1 := by1 + .1

                    end for
                label chr (200) :
                    for ii : 1 .. 10
                        bird (ii).y := bird (ii).y - 3
                        bullet (ii).y := bullet (ii).y - 3
                        by1 := by1 - .1

                    end for
                label :
            end case
        end if     %Hasch
        cls
        background (round (bx1), round (by1))
        background (round (bx1), round (by1) + 400)
        background (round (bx1), round (by1) - 400)

    end loop
end startgame
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%menu (num, x1, x2, y1, ksp, dsp, c1, c2 : int, s : array 1 .. 100 of string, n : int)


%menu (10, 220, 420, 10, 20, 20, 8, 1, menus, i)
procedure gamerules
    color (7)
    window (10, 10, 630, 390, 9, 14, "Game Rules")
    locate (4, 4)
    put "This a simple 2D shooting game. Your character is an astronut"
    locate (5, 4)
    put "who is equiped with a jetpack and a gun and he's trying to protect "
    locate (6, 4)
    put "his ship from flying aerolite by blowing them off the space."
    locate (7, 4)
    put "Controls :"
    locate (8, 4)
    put "d     --> Walk forward"
    locate (9, 4)
    put "a     --> Walk backward"
    locate (10, 4)
    put "w     --> Jump"
    locate (11, 4)
    put "Up    --> Move up"
    locate (12, 4)
    put "Down  --> Move down"
    locate (13, 4)
    put "Esc   --> Exit"
    locate (17, 10)
    put "           Press anykey to return to main menu . . ."
    window (10, 10, 630, 390, 9, 14, "Game Rules")
    loop
        exit when hasch
    end loop
end gamerules
colorback (8)
cls
menunum := 4
window (200, 50, 440, 300, 9, 14, "Main Menu")
menu (5, 220, 420, 100, 20, 20, 8, 9, menus, menunum)
color (14)
View.Set ("nooffscreenonly")
loop
    if hasch then
        window (200, 50, 440, 300, 9, 14, "Main Menu")
        case getchar of
            label chr (200) :
                if menunum < 4 then
                    menunum := menunum + 1
                end if
            label chr (208) :
                if menunum > 0 then
                    menunum := menunum - 1
                end if
            label chr (10) :
                put menunum
                case menunum of
                    label 4 :
                        cls
                        startgame
                        View.Set ("nooffscreenonly")
                        colorback (8)
                        cls
                        window (200, 50, 440, 300, 9, 14, "Main Menu")
                    label 3 :
                        cls
                        gameoptions (brspeed, blspeed, brnumber)
                        colorback (8)
                        cls
                        window (200, 50, 440, 300, 9, 14, "Main Menu")
                    label 2 :
                        cls
                        gamerules
                        colorback (8)
                        cls
                        window (200, 50, 440, 300, 9, 14, "Main Menu")
                    label 1 :
                        colorback (7)
                        cls
                        showscore
                        put "press any key to continue..."
                        loop
                            exit when hasch
                        end loop
                        colorback (8)
                        cls
                    label 0 :
                        exit
                    label :
                end case
            label :
        end case
        menu (5, 220, 420, 100, 20, 20, 8, 9, menus, menunum)
    end if
end loop
%gameoptions (brspeed, blspeed, brnumber)

notice the difference =Þ
Llama




PostPosted: Sat Apr 26, 2003 12:33 pm   Post subject: Car

It's an animation of a guy getting hit by a car 8) its pretty cheesy... but cool
code:

setscreen ("graphics:640;480")

%road
drawline (0, 200, 641, 200, 7)
drawline (0, 100, 641, 100, 7)
drawfill (1, 120, 0, 0)
drawfill (1, 1, 10, 7)

%house
drawline (20, 199, 20, 350, 7)
drawline (200, 200, 200, 350, 7)
drawline (0, 330, 110, 440, 7)
drawline (220, 330, 110, 440, 7)
drawfill (100, 300, 115, 7)
%door and windows
drawfillbox (90, 200, 130, 260, 7)
drawfillbox (140, 220, 190, 260, 0) %bottom right window
drawbox (140, 220, 190, 260, 7)
drawline (165, 260, 165, 220, 7)
drawline (140, 240, 190, 240, 7)
drawfillbox (30, 220, 80, 260, 0) %bottom left window
drawbox (30, 220, 80, 260, 7)
drawline (55, 260, 55, 220, 7)
drawline (30, 240, 80, 240, 7)
drawfillbox (30, 290, 90, 340, 0) %top left window
drawbox (30, 290, 90, 340, 7)
drawfillbox (130, 290, 190, 340, 0) %top right window
drawbox (130, 290, 190, 340, 7)

%tree
drawfillbox (520, 201, 580, 370, 187)
drawfilloval (550, 400, 70, 50, 143)

%man
drawoval (250, 260, 10, 10, 7)
drawline (250, 220, 250, 250, 7)
drawline (250, 220, 260, 200, 7)
drawline (250, 220, 240, 200, 7)
drawline (250, 240, 235, 230, 7)
drawline (250, 240, 265, 230, 7)
drawdot (247, 265, 7)
drawdot (253, 265, 7)
drawarc (250, 258, 5, 5, 200, 340, 7)
delay (1000)
drawoval (250, 260, 10, 10, 0)
drawline (250, 220, 250, 250, 0)
drawline (250, 220, 260, 200, 0)
drawline (250, 220, 240, 200, 0)
drawline (250, 240, 235, 230, 0)
drawline (250, 240, 265, 230, 0)
drawdot (247, 265, 0)
drawdot (253, 265, 0)
drawarc (250, 258, 5, 5, 200, 340, 0)

%walking
for c : 1 .. 90 by 2

    drawoval (250, 260 - c, 10, 10, 7)
    drawfill (250, 260 - c, 0, 7)
    drawline (250, 220 - c, 250, 250 - c, 7)
    drawline (250, 220 - c, 260, 200 - c, 7)
    drawline (250, 220 - c, 240, 200 - c, 7)
    drawline (250, 240 - c, 235, 230 - c, 7)
    drawline (250, 240 - c, 265, 230 - c, 7)
    drawdot (247, 265 - c, 7)
    drawdot (253, 265 - c, 7)
    drawarc (250, 258 - c, 5, 5, 200, 340, 7)
    delay (100)
    drawoval (250, 260 - c, 10, 10, 0)
    drawline (250, 220 - c, 250, 250 - c, 0)
    drawline (250, 220 - c, 260, 200 - c, 0)
    drawline (250, 220 - c, 240, 200 - c, 0)
    drawline (250, 240 - c, 235, 230 - c, 0)
    drawline (250, 240 - c, 265, 230 - c, 0)
    drawdot (247, 265 - c, 0)
    drawdot (253, 265 - c, 0)
    drawarc (250, 258 - c, 5, 5, 200, 340, 0)
    drawline (0, 200, 641, 200, 7)
end for
drawoval (250, 170, 10, 10, 7)
drawline (250, 130, 250, 160, 7)
drawline (250, 130, 260, 110, 7)
drawline (250, 130, 240, 110, 7)
drawline (250, 150, 235, 140, 7)
drawline (250, 150, 265, 140, 7)
drawfilloval (247, 175, 2, 2, 7)
drawfilloval (253, 175, 2, 2, 7)
drawoval (250, 165, 3, 3, 7)

%car
for c : 1 .. 640 by 20
    drawfillbox (1 + c, 130, 130 + c, 160, 9)
    drawfillbox (40 + c, 150, 80 + c, 180, 9)
    drawline (20 + c, 160, 40 + c, 180, 7)
    drawline (100 + c, 160, 80 + c, 180, 7)
    drawfilloval (20 + c, 120, 10, 10, 7)
    drawfilloval (110 + c, 120, 10, 10, 7)
    delay (50)
    drawfillbox (1 + c, 130, 130 + c, 160, 0)
    drawfillbox (40 + c, 150, 80 + c, 180, 0)
    drawline (20 + c, 160, 40 + c, 180, 0)
    drawline (100 + c, 160, 80 + c, 180, 0)
    drawfilloval (20 + c, 120, 10, 10, 0)
    drawfilloval (110 + c, 120, 10, 10, 0)
end for

%clears man
drawoval (250, 170, 10, 10, 0)
drawline (250, 130, 250, 160, 0)
drawline (250, 130, 260, 110, 0)
drawline (250, 130, 240, 110, 0)
drawline (250, 150, 235, 140, 0)
drawline (250, 150, 265, 140, 0)
drawfilloval (247, 175, 2, 2, 0)
drawfilloval (253, 175, 2, 2, 0)
drawoval (250, 165, 3, 3, 0)

%dead man
drawoval (250, 140, 10, 10, 7)
drawline (260, 140, 300, 140, 7)
drawline (300, 140, 320, 150, 7)
drawline (300, 140, 320, 130, 7)
drawline (270, 140, 290, 150, 7)
drawline (270, 140, 260, 130, 7)
drawline (245, 135, 248, 138, 7)
drawline (245, 138, 248, 135, 7)
drawline (245, 142, 248, 145, 7)
drawline (245, 145, 248, 142, 7)
drawarc (260, 140, 5, 5, 140, 230, 7)
delay (1000)


for decreasing d : 500 .. 1 by 4
    drawoval (270, 140, d, d, 12)
    delay (10)
end for
delay (100)
for c : 1 .. 550 by 2
    drawfilloval (270, 140, c, c, 12)
    delay (10)
end for

delay (1000)

%THE END
var font : int
font := Font.New ("Times New Roman:40")
Font.Draw ("The End", 230, 225, font, black)

%inclosing circle
for decreasing c : 500 .. 100
    drawoval (320, 240, c, c, 7)
    delay (5)
end for

delay (500)
for decreasing c : 100 .. 0
    drawoval (320, 240, c, c, 7)
    delay (2)
end for


HaHa. Thats preaty cool actually. You should have created your own post, but I'll give you +10 Bits anyway - Tony
Homer_simpson




PostPosted: Sat Apr 26, 2003 12:38 pm   Post subject: (No subject)

here's the flickerless version Llama
code:
setscreen ("graphics:640;480")
View.Set ("offscreenonly")
%road
drawline (0, 200, 641, 200, 7)
drawline (0, 100, 641, 100, 7)
drawfill (1, 120, 0, 0)
drawfill (1, 1, 10, 7)

%house
drawline (20, 199, 20, 350, 7)
drawline (200, 200, 200, 350, 7)
drawline (0, 330, 110, 440, 7)
drawline (220, 330, 110, 440, 7)
drawfill (100, 300, 115, 7)
%door and windows
drawfillbox (90, 200, 130, 260, 7)
drawfillbox (140, 220, 190, 260, 0) %bottom right window
drawbox (140, 220, 190, 260, 7)
drawline (165, 260, 165, 220, 7)
drawline (140, 240, 190, 240, 7)
drawfillbox (30, 220, 80, 260, 0) %bottom left window
drawbox (30, 220, 80, 260, 7)
drawline (55, 260, 55, 220, 7)
drawline (30, 240, 80, 240, 7)
drawfillbox (30, 290, 90, 340, 0) %top left window
drawbox (30, 290, 90, 340, 7)
drawfillbox (130, 290, 190, 340, 0) %top right window
drawbox (130, 290, 190, 340, 7)

%tree
drawfillbox (520, 201, 580, 370, 187)
drawfilloval (550, 400, 70, 50, 143)

%man
drawoval (250, 260, 10, 10, 7)
drawline (250, 220, 250, 250, 7)
drawline (250, 220, 260, 200, 7)
drawline (250, 220, 240, 200, 7)
drawline (250, 240, 235, 230, 7)
drawline (250, 240, 265, 230, 7)
drawdot (247, 265, 7)
drawdot (253, 265, 7)
drawarc (250, 258, 5, 5, 200, 340, 7)
delay (1000)
drawoval (250, 260, 10, 10, 0)
drawline (250, 220, 250, 250, 0)
drawline (250, 220, 260, 200, 0)
drawline (250, 220, 240, 200, 0)
drawline (250, 240, 235, 230, 0)
drawline (250, 240, 265, 230, 0)
drawdot (247, 265, 0)
drawdot (253, 265, 0)
drawarc (250, 258, 5, 5, 200, 340, 0)
View.Update
%walking
for c : 1 .. 90 by 2

    drawoval (250, 260 - c, 10, 10, 7)
    drawfill (250, 260 - c, 0, 7)
    drawline (250, 220 - c, 250, 250 - c, 7)
    drawline (250, 220 - c, 260, 200 - c, 7)
    drawline (250, 220 - c, 240, 200 - c, 7)
    drawline (250, 240 - c, 235, 230 - c, 7)
    drawline (250, 240 - c, 265, 230 - c, 7)
    drawdot (247, 265 - c, 7)
    drawdot (253, 265 - c, 7)
    drawarc (250, 258 - c, 5, 5, 200, 340, 7)
    View.Update
    delay (100)
    drawoval (250, 260 - c, 10, 10, 0)
    drawline (250, 220 - c, 250, 250 - c, 0)
    drawline (250, 220 - c, 260, 200 - c, 0)
    drawline (250, 220 - c, 240, 200 - c, 0)
    drawline (250, 240 - c, 235, 230 - c, 0)
    drawline (250, 240 - c, 265, 230 - c, 0)
    drawdot (247, 265 - c, 0)
    drawdot (253, 265 - c, 0)
    drawarc (250, 258 - c, 5, 5, 200, 340, 0)
    drawline (0, 200, 641, 200, 7)
end for
drawoval (250, 170, 10, 10, 7)
drawline (250, 130, 250, 160, 7)
drawline (250, 130, 260, 110, 7)
drawline (250, 130, 240, 110, 7)
drawline (250, 150, 235, 140, 7)
drawline (250, 150, 265, 140, 7)
drawfilloval (247, 175, 2, 2, 7)
drawfilloval (253, 175, 2, 2, 7)
drawoval (250, 165, 3, 3, 7)
View.Update
%car
for c : 1 .. 640 by 20
    drawfillbox (1 + c, 130, 130 + c, 160, 9)
    drawfillbox (40 + c, 150, 80 + c, 180, 9)
    drawline (20 + c, 160, 40 + c, 180, 7)
    drawline (100 + c, 160, 80 + c, 180, 7)
    drawfilloval (20 + c, 120, 10, 10, 7)
    drawfilloval (110 + c, 120, 10, 10, 7)
    View.Update
    delay (50)
    drawfillbox (1 + c, 130, 130 + c, 160, 0)
    drawfillbox (40 + c, 150, 80 + c, 180, 0)
    drawline (20 + c, 160, 40 + c, 180, 0)
    drawline (100 + c, 160, 80 + c, 180, 0)
    drawfilloval (20 + c, 120, 10, 10, 0)
    drawfilloval (110 + c, 120, 10, 10, 0)
end for

%clears man
drawoval (250, 170, 10, 10, 0)
drawline (250, 130, 250, 160, 0)
drawline (250, 130, 260, 110, 0)
drawline (250, 130, 240, 110, 0)
drawline (250, 150, 235, 140, 0)
drawline (250, 150, 265, 140, 0)
drawfilloval (247, 175, 2, 2, 0)
drawfilloval (253, 175, 2, 2, 0)
drawoval (250, 165, 3, 3, 0)
View.Update
%dead man
drawoval (250, 140, 10, 10, 7)
drawline (260, 140, 300, 140, 7)
drawline (300, 140, 320, 150, 7)
drawline (300, 140, 320, 130, 7)
drawline (270, 140, 290, 150, 7)
drawline (270, 140, 260, 130, 7)
drawline (245, 135, 248, 138, 7)
drawline (245, 138, 248, 135, 7)
drawline (245, 142, 248, 145, 7)
drawline (245, 145, 248, 142, 7)
drawarc (260, 140, 5, 5, 140, 230, 7)
View.Update
delay (1000)


for decreasing d : 500 .. 1 by 4
    drawoval (270, 140, d, d, 12)
    View.Update
    delay (10)
end for
delay (100)
for c : 1 .. 550 by 2
    drawfilloval (270, 140, c, c, 12)
    View.Update
    delay (10)
end for

delay (1000)

%THE END
var font : int
font := Font.New ("Times New Roman:40")
Font.Draw ("The End", 230, 225, font, black)

%inclosing circle
for decreasing c : 500 .. 100
    drawoval (320, 240, c, c, 7)
    View.Update
    delay (5)
end for

delay (500)
for decreasing c : 100 .. 0
    drawoval (320, 240, c, c, 7)
    View.Update
    delay (2)
end for
RscMod




PostPosted: Tue Apr 26, 2005 10:37 am   Post subject: (No subject)

ive seen this b4 only it had pizza on the truck here it is





setscreen ("graphics:640;480")
View.Set ("offscreenonly")
var font : int

%road
drawline (0, 200, 641, 200, 7)
drawline (0, 100, 641, 100, 7)
drawfill (1, 120, 0, 0)
drawfill (1, 1, 10, 7)

%house
drawline (20, 199, 20, 350, 7)
drawline (200, 200, 200, 350, 7)
drawline (0, 330, 110, 440, 7)
drawline (220, 330, 110, 440, 7)
drawfill (100, 300, 115, 7)
%door and windows
drawfillbox (90, 200, 130, 260, 7)
drawfillbox (140, 220, 190, 260, 0) %bottom right window
drawbox (140, 220, 190, 260, 7)
drawline (165, 260, 165, 220, 7)
drawline (140, 240, 190, 240, 7)
drawfillbox (30, 220, 80, 260, 0) %bottom left window
drawbox (30, 220, 80, 260, 7)
drawline (55, 260, 55, 220, 7)
drawline (30, 240, 80, 240, 7)
drawfillbox (30, 290, 90, 340, 0) %top left window
drawbox (30, 290, 90, 340, 7)
drawfillbox (130, 290, 190, 340, 0) %top right window
drawbox (130, 290, 190, 340, 7)

%tree
drawfillbox (520, 201, 580, 370, 187)
drawfilloval (550, 400, 70, 50, 143)

%man
drawoval (250, 260, 10, 10, 7)
drawline (250, 220, 250, 250, 7)
drawline (250, 220, 260, 200, 7)
drawline (250, 220, 240, 200, 7)
drawline (250, 240, 235, 230, 7)
drawline (250, 240, 265, 230, 7)
drawdot (247, 265, 7)
drawdot (253, 265, 7)
drawarc (250, 258, 5, 5, 200, 340, 7)
delay (1000)
drawoval (250, 260, 10, 10, 0)
drawline (250, 220, 250, 250, 0)
drawline (250, 220, 260, 200, 0)
drawline (250, 220, 240, 200, 0)
drawline (250, 240, 235, 230, 0)
drawline (250, 240, 265, 230, 0)
drawdot (247, 265, 0)
drawdot (253, 265, 0)
drawarc (250, 258, 5, 5, 200, 340, 0)
View.Update
%walking
for c : 1 .. 90 by 2

drawoval (250, 260 - c, 10, 10, 7)
drawfill (250, 260 - c, 0, 7)
drawline (250, 220 - c, 250, 250 - c, 7)
drawline (250, 220 - c, 260, 200 - c, 7)
drawline (250, 220 - c, 240, 200 - c, 7)
drawline (250, 240 - c, 235, 230 - c, 7)
drawline (250, 240 - c, 265, 230 - c, 7)
drawdot (247, 265 - c, 7)
drawdot (253, 265 - c, 7)
drawarc (250, 258 - c, 5, 5, 200, 340, 7)
View.Update
delay (100)
drawoval (250, 260 - c, 10, 10, 0)
drawline (250, 220 - c, 250, 250 - c, 0)
drawline (250, 220 - c, 260, 200 - c, 0)
drawline (250, 220 - c, 240, 200 - c, 0)
drawline (250, 240 - c, 235, 230 - c, 0)
drawline (250, 240 - c, 265, 230 - c, 0)
drawdot (247, 265 - c, 0)
drawdot (253, 265 - c, 0)
drawarc (250, 258 - c, 5, 5, 200, 340, 0)
drawline (0, 200, 641, 200, 7)
end for
drawoval (250, 170, 10, 10, 7)
drawline (250, 130, 250, 160, 7)
drawline (250, 130, 260, 110, 7)
drawline (250, 130, 240, 110, 7)
drawline (250, 150, 235, 140, 7)
drawline (250, 150, 265, 140, 7)
drawfilloval (247, 175, 2, 2, 7)
drawfilloval (253, 175, 2, 2, 7)
drawoval (250, 165, 3, 3, 7)
View.Update
%car
for c : 1 .. 640 by 20
drawfillbox (1 + c, 130, 130 + c, 160, 9)
drawfillbox (40 + c, 150, 80 + c, 180, 9)
drawline (20 + c, 160, 40 + c, 180, 7)
drawline (110 + c, 160, 80 + c, 180, 7)
drawfilloval (20 + c, 120, 10, 10, 7)
drawfilloval (110 + c, 120, 10, 10, 7)
drawoval (87+c,166,5,5,7)
drawdot (89+c,168,7)
drawline (88+c,165,90+c,163,7)
font := Font.New ("Times New Roman:25")
Font.Draw ("Pizza", 25 + c, 135, font, 0)
View.Update
delay (60)
font := Font.New ("Times New Roman:20")
Font.Draw ("Pizza Hut", 25 + c, 135, font, 0)
drawfillbox (1 + c, 130, 130 + c, 160, 0)
drawfillbox (40 + c, 150, 80 + c, 180, 0)
drawline (20 + c, 160, 40 + c, 180, 0)
drawline (110 + c, 160, 80 + c, 180, 0)
drawfilloval (20 + c, 120, 10, 10, 0)
drawfilloval (110 + c, 120, 10, 10, 0)
end for


%clears man
drawoval (250, 170, 10, 10, 0)
drawline (250, 130, 250, 160, 0)
drawline (250, 130, 260, 110, 0)
drawline (250, 130, 240, 110, 0)
drawline (250, 150, 235, 140, 0)
drawline (250, 150, 265, 140, 0)
drawfilloval (247, 175, 2, 2, 0)
drawfilloval (253, 175, 2, 2, 0)
drawoval (250, 165, 3, 3, 0)
View.Update
%dead man
drawoval (250, 140, 10, 10, 7)
drawline (260, 140, 300, 140, 7)
drawline (300, 140, 320, 150, 7)
drawline (300, 140, 320, 130, 7)
drawline (270, 140, 290, 150, 7)
drawline (270, 140, 260, 130, 7)
drawline (245, 135, 248, 138, 7)
drawline (245, 138, 248, 135, 7)
drawline (245, 142, 248, 145, 7)
drawline (245, 145, 248, 142, 7)
drawarc (260, 140, 5, 5, 140, 230, 7)
View.Update
delay (1000)


for decreasing d : 500 .. 1 by 4
drawoval (270, 140, d, d, 12)
View.Update
delay (10)
end for
delay (100)
for c : 1 .. 550 by 2
drawfilloval (270, 140, c, c, 12)
View.Update
delay (10)
end for

delay (1000)

%THE END
font := Font.New ("Times New Roman:40")
Font.Draw ("The End", 230, 225, font, black)

%inclosing circle
for decreasing c : 500 .. 100
drawoval (320, 240, c, c, 7)
View.Update
delay (5)
end for

delay (500)
for decreasing c : 100 .. 0
drawoval (320, 240, c, c, 7)
View.Update
delay (2)
end for
Sponsor
Sponsor
Sponsor
sponsor
jamonathin




PostPosted: Tue Apr 26, 2005 11:41 am   Post subject: (No subject)

Please make use of the
code:
[code][/code]
tags and the news posts on the main page @ http://www.compsci.ca/mx
Bacchus




PostPosted: Tue Apr 26, 2005 6:53 pm   Post subject: (No subject)

also look at the year the last post b4 by Homer Simpson was made. also my cousin showed me this b4, he said he made it...
Homer_simpson




PostPosted: Thu Apr 28, 2005 9:32 pm   Post subject: (No subject)

what did you call me?!
Bacchus




PostPosted: Thu Apr 28, 2005 9:43 pm   Post subject: (No subject)

i called you Homer Simpson, not much different from ur name Homer_simpson is it? as for the thing i said about my cousin making that, i remembered Llama was his old account here lol
gafiga




PostPosted: Sun Jun 22, 2008 11:17 am   Post subject: RE:2D shooter game

I liked it, it was short and simple. the only thing i didn't like was how slow the bullets moved and how you couldn't shoot the other way. Other then that, its was alright. Smile
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 13 Posts ]
Jump to:   


Style:  
Search: