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

Username:   Password: 
 RegisterRegister   
 PLEASE HELP FAASSSTT>>Project Due Tomorrow!!!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Kaptesh




PostPosted: Wed Jan 19, 2005 8:31 pm   Post subject: PLEASE HELP FAASSSTT>>Project Due Tomorrow!!!

Hey guys please help me...I'm a TOTAL newbie..
code:

var chars : array char of boolean
var x, y, c : int
x := 4
y := 4
c := Rand.Int (0, maxcolor)



loop


    Input.KeyDown (chars)

    if chars (KEY_UP_ARROW) then
        y := y + 5
        delay (5)

    elsif chars (KEY_RIGHT_ARROW) then
        x := x + 5
        delay (5)

    elsif chars (KEY_LEFT_ARROW) then
        x := x - 5
        delay (5)

    elsif chars (KEY_DOWN_ARROW) then
        y := y - 5
        delay (5)

    elsif chars (KEY_ALT) then
        if y>0 then drawfilloval (x, y, 10, 10, Rand.Int (0, maxcolor))
        end if
delay (500)
    end if

    drawfilloval (x, y, 4, 4, c)
    delay (5)

end loop

Everything works..but when I press ALT I want the ball to change colour and draw with that new colour..Please someone help!!! Sad Sad
Sponsor
Sponsor
Sponsor
sponsor
Martin




PostPosted: Wed Jan 19, 2005 8:34 pm   Post subject: (No subject)

code:
elsif chars (KEY_ALT) then
    c := Rand.Int(0,maxcolor)
else ...


That's all you need.

Also, you should make them seperate if statements (ie. if keys(KEY_UP_ARROW) then ... end if if keys (KEY_LEFT_ARROW) then .. end if)

That way, if users press up and left, it moves the ball up and left.
Kaptesh




PostPosted: Wed Jan 19, 2005 9:03 pm   Post subject: (No subject)

Wow...that was fast..thankks man it works... Very Happy
Tony




PostPosted: Thu Jan 20, 2005 9:30 am   Post subject: (No subject)

that's his project?
Shocked
just imagine that kind of an awesome colour changing program this kid would be able to make once he graduates from that school Laughing
Neo




PostPosted: Thu Jan 20, 2005 10:28 am   Post subject: (No subject)

tony wrote:
that's his project?
Shocked
just imagine that kind of an awesome colour changing program this kid would be able to make once he graduates from that school Laughing


It probably is just a small protion of his final project, the larger part is a 3D FPS with dynamic lighting and the like. Laughing
Pip_Jr




PostPosted: Thu Jan 20, 2005 10:09 pm   Post subject: (No subject)

Dude... My project is harder then that... adn i'm in grade 9 and i'm geting pissed off! couse my teacher is being an ass Twisted Evil

I need to make hang man with arrays and proccedures, and i lost my notes =S
eNc




PostPosted: Fri Jan 21, 2005 9:49 am   Post subject: (No subject)

Pip_Jr wrote:
Dude... My project is harder then that... adn i'm in grade 9 and i'm geting pissed off! couse my teacher is being an ass Twisted Evil

I need to make hang man with arrays and proccedures, and i lost my notes =S


Lost or didn't take ? I kno im compsci I never take notes lol.
Tony




PostPosted: Fri Jan 21, 2005 12:38 pm   Post subject: (No subject)

the only notes there are to take is proper syntax reference..

and I just print out the documentation that comes with whatever library I'm using Wink
Sponsor
Sponsor
Sponsor
sponsor
MysticVegeta




PostPosted: Sat Jan 22, 2005 11:15 am   Post subject: (No subject)

Pip_Jr wrote:
Dude... My project is harder then that... adn i'm in grade 9 and i'm geting pissed off! couse my teacher is being an ass Twisted Evil

I need to make hang man with arrays and proccedures, and i lost my notes =S


Wow i got hangman for isp too and i handed it in. Its not that hard!!! Very Happy
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: