
-----------------------------------
agent_orange444
Thu Jan 22, 2004 4:06 pm

Catch the Box Game
-----------------------------------
This is a game that i quikly made cause i was board (1 night).  Your goal is to keep your mouse inside a randomly moving box.  You click to start, and can click to reset.  Enjoy!


var x, x2, y, y2, mx, my, start, button, num, buttonnumber, score,
    buttonupdown, speed, size, change, maxspeed, minspeed,
    butx, buty : int
setscreen ("graphics:vga")
loop
    num := 10
    x2 := 1
    y2 := 1
    start := 1
    score := 0
    %size of the box (defualt = 10)
    size := 10
    %speed the box moves (75-125)
    maxspeed := 50
    minspeed := 125
    randint (x, 0, 625)
    randint (y, 0, 365)
    %optional set start location
    %x:=
    %y:=

    loop

        randint (change, 1, 10)
        drawline (0, 375, 625, 375, 7)
        randint (speed, maxspeed, minspeed)

        if num = 10 then
            randint (x2, - 1, 1)
            randint (y2, - 1, 1)
        end if

        drawfillbox (x, y, x + size, y + size, 3)
        delay (speed)

        if start = 1 then
            put "Click to Start - keep your mouse in the box"
            buttonwait ("down", butx, buty, buttonnumber, buttonupdown)
            start := start + 1
        end if

        drawfillbox (x, y, x + size, y + size, 0)
        num := num + change

        if num > 20 then
            num := 0
        end if

        x := x + x2
        y := y + y2

        if x = 0 then
            x := x + 1
        elsif x >= 625 then
            x := x - 1
        end if

        if y = 0 then
            y := y + 1
        elsif y >= 365 then
            y := y - 1
        end if

        mousewhere (mx, my, button)
        if mx > x - 1 and mx < x + size + 1 and my > y - 1 and my < y + size
                + 1 then
            score := score + 1
            locate (1, 1)
            put "score= ", score
        else
            cls
            exit
        end if
    end loop
    put "Game Over - Your Score was: ", score
    buttonwait ("down", butx, buty, buttonnumber, buttonupdown)
    cls
end loop



-----------------------------------
kalin
Thu Jan 22, 2004 4:11 pm


-----------------------------------
Hey, cool. I like it

-----------------------------------
agent_orange444
Thu Jan 22, 2004 4:13 pm


-----------------------------------
thnx, i just had a cool idea to make the box move faster as you get higher scores!  By the way my record is 205, try and beat it!

-----------------------------------
kalin
Thu Jan 22, 2004 4:14 pm


-----------------------------------
I have a hard time reaching 40.....But I'll try! And yeah, that is a cool idea.

[added] 230! yay, sheer determination!

-----------------------------------
shorthair
Thu Jan 22, 2004 4:23 pm


-----------------------------------
got to 48 max , just got lucky , very well done get some background music to keep you going , and mabye turn it into a level besed game , where the box gets smaller and it moves faster every say 50 points , that would be BIT worthy to me

-----------------------------------
agent_orange444
Thu Jan 22, 2004 4:28 pm


-----------------------------------
thnx, i love that idea! im gonna get workin on it right away!  But what do u mean by bit worthy?

-----------------------------------
shorthair
Thu Jan 22, 2004 4:29 pm


-----------------------------------
go look around the shop to ee what magical bits can do for you

-----------------------------------
kalin
Thu Jan 22, 2004 4:31 pm


-----------------------------------
lol. I still dont really get them, but whatever. Oh well. I think its actually kinmda cool as it is, but yeah. Make it a lvling game and such, it would be really cool after that.

Also, I dunno, do either of you know how to set a timer?? I looked and didn't see anything about that that would help. So, do either of you know. If not it's cool.

-----------------------------------
shorthair
Thu Jan 22, 2004 4:45 pm


-----------------------------------
A countdown timer , or a count up timer

-----------------------------------
kalin
Thu Jan 22, 2004 4:49 pm


-----------------------------------
count up.

-----------------------------------
shorthair
Thu Jan 22, 2004 4:55 pm


-----------------------------------
var timeRunning : int
loop 
       timeRunning := Time.Elapsed
    locate (10 ,20)
       put "This program has run ", timeRunning, " milliseconds"
end loop


can i have some bits  :cry:  im without , 