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

Username:   Password: 
 RegisterRegister   
 Plz Can someone help me wiht my project!!!!! =P
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
dirk87




PostPosted: Sun Apr 13, 2008 11:53 am   Post subject: Plz Can someone help me wiht my project!!!!! =P

proc stickman
drawoval (500,100,10,10,black)
drawline (500,90,500,50,black)
drawline (480,70,520,70,black)
drawline (500,50,490,30,black)
drawline (500,50,510,30,black)
drawfilloval (504,101,2,2,black)
drawfilloval (496,101,2,2,black)

end stickman
this is the code for my stick man.....can soemone plz help me move him from right to left on the screen to like 300 x coordinate.
Below is my program....i need to make my stickman move to roughly around where the door is on my building...then i wanna clear screen and show the inside and just make a black bowling ball slide down the lane and hit soem pins....if anyone could plz help me with this i would greatly appreciate it. =)

%********************************
%name block TIK TIK TIK TIK TIK
%name -
%date -
%program description
%*********************************
%
%
%*********************************
%Algorithm
%A set of instructions in order, used to pre-plan a program
%*********************************
%
%
%*********************************
%Variables Dictionary
%declare variable by name and type
var picID : int
var x, y : int
%*********************************
%
%
%*********************************
%Procedures/Subprograms/Subroutines
%do each seperatly in a block
proc building

drawfillbox (0, 480, 640, 170, blue)
drawfillbox (40, 50, 360, 300, 187)
drawfillbox (250, 50, 150, 130, black)
drawline (200, 50, 200, 130, white)
setscreen ("graphics")
drawfilloval (240, 100, 5, 5, yellow)
drawfillbox (110, 200, 290, 280, white)
drawbox (111, 199, 289, 279, blue)
const testString : string := "Essex Bowling Lanes "
var width : int
var fontID : int
fontID := Font.New ("Palatino:12:Bold")

width := Font.Width (testString, fontID)
Font.Draw (testString, 120, 230, fontID, black)
Font.Free (fontID)
end building

proc cloud
for c : -100 .. 700
drawfilloval (c + 0, 300, 20, 20, grey)
drawfilloval (c + 0, 320, 20, 20, grey)
drawfilloval (c + 10, 310, 20, 20, grey)
drawfilloval (c + -20, 320, 20, 20, grey)
drawfilloval (c + -30, 320, 20, 20, grey)
drawfilloval (c + -30, 300, 20, 20, grey)
drawfilloval (c + -30, 290, 20, 20, grey)
drawfilloval (c + -40, 300, 20, 20, grey)
drawfilloval (c + -40, 310, 20, 20, grey)
drawfilloval (c + -50, 300, 20, 20, grey)
drawfilloval (c + -50, 305, 20, 20, grey)
drawfilloval (c + -60, 290, 20, 20, grey)
drawfilloval (c + -50, 320, 50, 20, grey)
drawfilloval (c + -50, 320, 30, 30, grey)
drawfilloval (c + -50, 280, 20, 20, grey)
drawfilloval (c + -60, 290, 20, 20, grey)
drawfilloval (c + -60, 290, 20, 20, grey)
drawfilloval (c + -80, 300, 25, 20, grey)
delay (1)
drawfilloval (c + 0, 300, 20, 20, 100)
drawfilloval (c + 0, 320, 20, 20, 100)
drawfilloval (c + 10, 310, 20, 20, 100)
drawfilloval (c + -20, 320, 20, 20, 100)
drawfilloval (c + -30, 320, 20, 20, 100)
drawfilloval (c + -30, 300, 20, 20, 100)
drawfilloval (c + -30, 290, 20, 20, 100)
drawfilloval (c + -40, 300, 20, 20, 100)
drawfilloval (c + -40, 310, 20, 20, 100)
drawfilloval (c + -50, 300, 20, 20, 100)
drawfilloval (c + -50, 305, 20, 20, 100)
drawfilloval (c + -60, 290, 20, 20, 100)
drawfilloval (c + -50, 320, 50, 20, 100)
drawfilloval (c + -50, 320, 30, 30, 100)
drawfilloval (c + -50, 280, 20, 20, 100)
drawfilloval (c + -60, 290, 20, 20, 100)
drawfilloval (c + -60, 290, 20, 20, 100)
drawfilloval (c + -80, 300, 25, 20, 100)
building
end for
end cloud
proc stickman
drawoval (500,100,10,10,black)
drawline (500,90,500,50,black)
drawline (480,70,520,70,black)
drawline (500,50,490,30,black)
drawline (500,50,510,30,black)
drawfilloval (504,101,2,2,black)
drawfilloval (496,101,2,2,black)

end stickman

proc speech
locatexy (475, 150)
put "Bowling!"
drawoval (500, 150, 35, 35, black)
delay (40)
locatexy (501, 150)
end speech

%*********************************
%
%
%*********************************
%Mainline
%step by step enter the program
building
cloud
stickman
speech

%*********************************
Sponsor
Sponsor
Sponsor
sponsor
CodeMonkey2000




PostPosted: Sun Apr 13, 2008 12:48 pm   Post subject: RE:Plz Can someone help me wiht my project!!!!! =P

Make a variable that knows the displacement of the stick man relative to his starting location. Over the the displacement should gradually increase. This number should be added to you x coordinates. Once the displacement hits a number that is close to your door, do whatever you are suppose to do next. To get the the number that is close, you'll need to experiment.
lordroba




PostPosted: Sun Apr 13, 2008 2:57 pm   Post subject: Re: Plz Can someone help me wiht my project!!!!! =P

Turing:


%This is the variable that stores the displacement
var d : int := 0
proc stickman
    drawoval (500 + d, 100, 10, 10, black)
    drawline (500 + d, 90, 500 + d, 50, black)
    drawline (480 + d, 70, 520 + d, 70, black)
    drawline (500 + d, 50, 490 + d, 30, black)
    drawline (500 + d, 50, 510 + d, 30, black)
    drawfilloval (504 + d, 101, 2, 2, black)
    drawfilloval (496 + d, 101, 2, 2, black)

end stickman

proc building
    drawfillbox (0, 480, 640, 170, blue)
    drawfillbox (40, 50, 360, 300, 187)
    drawfillbox (250, 50, 150, 130, black)
    drawline (200, 50, 200, 130, white)
    setscreen ("graphics")
    drawfilloval (240, 100, 5, 5, yellow)
    drawfillbox (110, 200, 290, 280, white)
    drawbox (111, 199, 289, 279, blue)
    const testString : string := "Essex Bowling Lanes "
    var width : int
    var fontID : int
    fontID := Font.New ("Palatino:12:Bold")

    width := Font.Width (testString, fontID)
    Font.Draw (testString, 120, 230, fontID, black)
    Font.Free (fontID)
end building

proc cloud
    for c : -100 .. 700
        drawfilloval (c + 0, 300, 20, 20, grey)
        drawfilloval (c + 0, 320, 20, 20, grey)
        drawfilloval (c + 10, 310, 20, 20, grey)
        drawfilloval (c + -20, 320, 20, 20, grey)
        drawfilloval (c + -30, 320, 20, 20, grey)
        drawfilloval (c + -30, 300, 20, 20, grey)
        drawfilloval (c + -30, 290, 20, 20, grey)
        drawfilloval (c + -40, 300, 20, 20, grey)
        drawfilloval (c + -40, 310, 20, 20, grey)
        drawfilloval (c + -50, 300, 20, 20, grey)
        drawfilloval (c + -50, 305, 20, 20, grey)
        drawfilloval (c + -60, 290, 20, 20, grey)
        drawfilloval (c + -50, 320, 50, 20, grey)
        drawfilloval (c + -50, 320, 30, 30, grey)
        drawfilloval (c + -50, 280, 20, 20, grey)
        drawfilloval (c + -60, 290, 20, 20, grey)
        drawfilloval (c + -60, 290, 20, 20, grey)
        drawfilloval (c + -80, 300, 25, 20, grey)
        delay (1)
        drawfilloval (c + 0, 300, 20, 20, 100)
        drawfilloval (c + 0, 320, 20, 20, 100)
        drawfilloval (c + 10, 310, 20, 20, 100)
        drawfilloval (c + -20, 320, 20, 20, 100)
        drawfilloval (c + -30, 320, 20, 20, 100)
        drawfilloval (c + -30, 300, 20, 20, 100)
        drawfilloval (c + -30, 290, 20, 20, 100)
        drawfilloval (c + -40, 300, 20, 20, 100)
        drawfilloval (c + -40, 310, 20, 20, 100)
        drawfilloval (c + -50, 300, 20, 20, 100)
        drawfilloval (c + -50, 305, 20, 20, 100)
        drawfilloval (c + -60, 290, 20, 20, 100)
        drawfilloval (c + -50, 320, 50, 20, 100)
        drawfilloval (c + -50, 320, 30, 30, 100)
        drawfilloval (c + -50, 280, 20, 20, 100)
        drawfilloval (c + -60, 290, 20, 20, 100)
        drawfilloval (c + -60, 290, 20, 20, 100)
        drawfilloval (c + -80, 300, 25, 20, 100)
        building
    end for
end cloud
stickman


proc speech
    locatexy (475, 150)
    put "Bowling!"
    drawoval (500, 150, 35, 35, black)
    delay (40)
    locatexy (501, 150)
end speech

building
cloud
%change the value of d here
for i : 1 .. 85
    delay (50)
    cls
    building
    stickman
    d := d - 3
end for
speech


btw, you might want to get rid of the flickering with View.Update but you should learn that on your own or check out the forums if you're stuck. Hope this helps. Very Happy
DaveAngus




PostPosted: Sun Apr 13, 2008 3:23 pm   Post subject: RE:Plz Can someone help me wiht my project!!!!! =P

For the clearing of the screen just add cls under lordroba's code. Then you are free to do another for loop under that which can be the inside of the bowling alley.
Try doing the inside on your own:) Make this project worth while! People on here wont be able to help forever! hahaha
Good luck!
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  [ 4 Posts ]
Jump to:   


Style:  
Search: