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

Username:   Password: 
 RegisterRegister   
 Addictive Game
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
aussilia




PostPosted: Sat Dec 03, 2005 10:07 pm   Post subject: Addictive Game

Hello, this is my second post but my first game. Hope you like it.
Arrow (Please post replies!! Thanks) Wink
code:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%                             HIT THE FIRE!                                   %
%                                                                             %
%                            BY: ILIA BARANOV                                 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
setscreen ("graphics: max,max")
var x1, x2, y2, colorI, colorII : int
var size : int := 1
var x, y, button : int
var level : string
var counter : int := 5
var counterI : int := 0

locate (maxrow div 2, maxcol div 2)
put "Welcome to 'STOP THE EXPLOSION'!"
put skip
delay (3000)
put "Click on the explosions with your mouse to douse them with water"
delay (3000)
put "You will then recieve a point"
delay (3000)
put skip
put "If you do not hit them before they start shrinking, you lose a point"
delay (3000)
put skip
put "The game gets harder as the levels go higher"
delay (3000)
put skip
put "The game ends when you have a negative amount of points"
delay (3000)
put skip
put "Have fun!"
delay (1000)
put "(hit the mouse button to continue)"
loop
    Mouse.Where (x, y, button)
    if button = 1 then
        exit
    end if
end loop
cls
delay (100)

loop
    if counterI = 0 then
        cls
        locate (maxrow div 2, maxcol div 2)
        level := "First Level"
        put level
        delay (3000)
        randint (x1, 20, 400)
    else
        if counterI = 20 then
            cls
            locate (maxrow div 2, maxcol div 2)
            level := "Second Level"
            put level
            delay (3000)
            randint (x1, 15, 200)
        else
            if counterI = 40 then
                cls
                locate (maxrow div 2, maxcol div 2)
                level := "Third Level"
                put level
                delay (1000)
                randint (x1, 15, 100)
            else
                if counterI = 60 then
                    cls
                    locate (maxrow div 2, maxcol div 2)
                    level := "Fourth Level"
                    put level
                    delay (3000)
                    randint (x1, 15, 70)
                else
                    if counterI = 85 then
                        cls
                        locate (maxrow div 2, maxcol div 2)
                        level := "Expert level! (ARE YOU HUMAN??)"
                        put level
                        delay (3000)
                        randint (x1, 15, 50)
                    end if
                end if
            end if
        end if
    end if

    randint (colorI, 39, 44)
    randint (x2, 1, maxx)
    randint (y2, 1, maxy)
    colorII := colorI + 50


    for i : 0 .. x1
        Mouse.Where (x, y, button)
        drawdot (x, y, 0)
        drawfilloval (x2, y2, 10 + size, 10 + size, colorI)
        size := size + 1
        if whatdotcolor (x, y) not= 0 then
            if button = 1 then
                counter := counter + 1
                counterI := counterI + 1
                drawfilloval (x2, y2, 10 + size, 10 + size, brightblue)
                delay (200)
                exit
            end if
        end if
        delay (5)
    end for

    if whatdotcolor (x, y) not= brightblue then
        counter := counter - 1
    end if

    locate (maxrow div 2, maxcol div 2)
    put counter
    put level

    for g : 1 .. 50
        drawfilloval (x2, y2, 10 + size, 10 + size, colorII)
    end for

    delay (200)

    for h : 1 .. 200
        drawoval (x2, y2, 10 + size, 10 + size, white)
        size := size - 1
        delay (1)
    end for

    cls
    size := 1

    if counter < 0 then
        cls
        locate (maxrow div 2, maxcol div 2)
        put "You Lose! Nice try, you got ", counterI, " explosions!"
        delay (3000)
        put skip
        locate (maxrow div 2, maxcol div 2)
        put "Goodbye!"
        delay (1000)
        exit
    end if
    if counterI = 100 then
        cls
        locate (maxrow div 2, maxcol div 2)
        put "YOU WIN!!! GREAT JOB!!!"
        delay (2000)
        exit
    end if
end loop
Sponsor
Sponsor
Sponsor
sponsor
[Gandalf]




PostPosted: Sun Dec 04, 2005 1:53 pm   Post subject: (No subject)

Not a bad first game, a slightly original idea, nice Smile.

Two things pop out at once. First, only use delays when you have to, and most of the time when you do, use Time.DelaySinceLast(), but I don't think that applies to you program. Next, if statements don't work the way you have been using them (that syntax could be valid in a C-type language, not Turing), look up the if statement tutorial in the [Turing Tutorials] section. Use elsif instead of multiple else ... if statements.

Also, you might want to practice programming more proceduraly - check out the tutorial on procedures to help you out a bit with that.
Paul




PostPosted: Mon Dec 05, 2005 4:49 pm   Post subject: (No subject)

Its also possible to "cheat" by continuously holding down the mouse button, and douse fires just by moving your mouse to that point.
... Why is it that I always see the exploits to any games, for me often finding exploits is more fun than the game itself Shocked
Tony




PostPosted: Mon Dec 05, 2005 4:59 pm   Post subject: (No subject)

Paul wrote:
... Why is it that I always see the exploits to any games, for me often finding exploits is more fun than the game itself Shocked

You see right through code Paul Laughing excellent

It's quite interesting actually, though I disapprove of the use of whatdotcolour() Confused Would be better off with just checking for the radius against distance; it would also be possible to give bonus points for catching that explosion really fast Wink
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
Spitfyre




PostPosted: Thu Jan 05, 2006 6:18 pm   Post subject: (No subject)

this game isnt that bad ....time killing rules
[Gandalf]




PostPosted: Thu Jan 05, 2006 8:48 pm   Post subject: (No subject)

Please read the rules I posted in some other topic you posted in. In case you haven't read it, they are found here. Do not post in old topics, it's exactly a month old, that's enough to justify not posting an eight word comment.
vstm




PostPosted: Tue Jan 17, 2006 2:16 pm   Post subject: (No subject)

great game,

Do you not read? Look at [Gandalf]'s post, immediately above yours. Read the rules. Don't spam, and don't ressurect semi-old topics to spam.
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  [ 7 Posts ]
Jump to:   


Style:  
Search: