
-----------------------------------
Jekate
Fri Sep 29, 2006 7:43 pm

Yes, another pong game.
-----------------------------------
Ok, I'm working on a basic pong game for now. Not for class, just for fun. Anyways, this is what I got so far, with NO processes:

var ballx, bally, vx, vy, y1, y2 : int
var chars : array char of boolean

y2 := maxy div 2 - 25
y1 := maxy div 2 - 25
ballx := maxx div 2
bally := maxy div 2
vx := 3
vy := 3

View.Set ("offscreenonly")
loop
    cls

    Input.KeyDown (chars)
    if chars ('w') then
        y1 += 3
    elsif chars ('s') then
        y1 -= 3
    end if
    if chars (KEY_UP_ARROW) then
        y2 += 3
    elsif chars (KEY_DOWN_ARROW) then
        y2 -= 3
    end if

    ballx += vx
    bally += vy
    if (ballx + 10) >= maxx or (ballx - 10) = maxy or (bally - 10) = maxy then
        y1 := maxy - 51
    elsif y1 = maxy then
        y2 := maxy - 51
    elsif y2 = maxx or (ballx - 10) = maxy or (bally - 10) = y2 and bally = maxx - 20 then
        vx *= -1
    elsif bally >= y1 and bally 