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

Username:   Password: 
 RegisterRegister   
 need help with fp car game
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
bones




PostPosted: Wed Jun 08, 2005 10:44 am   Post subject: need help with fp car game

Im making a car game for my fp, but i cant figure out pic.rotate in my program. Its kind of noob but i just started over and i got this far in 2 days but im stuck. Thanks in advance!

code:
setscreen ("graphics:1012;657")
setscreen ("nocursor")

drawfillbox (145, 0, maxx - 145, 145, grey)
drawfillbox (145, maxy - 145, maxx - 145, maxy, grey)
drawfillbox (0, 145, 145, maxy - 145, grey)
drawfillbox (maxx - 145, 145, maxx, maxy - 145, grey)
%top right
drawfillarc (maxx - 145, maxy - 145, 145, 145, 0, 90, grey)
drawfillarc (maxx - 145, maxy - 145, (145 div 2 + 3), (145 div 2 + 3), 0, 90, yellow)
drawfillarc (maxx - 145, maxy - 145, (145 div 2 - 2), (145 div 2 - 2), 0, 90, grey)
%top left
drawfillarc (145, maxy - 145, 145, 145, 90, 180, grey)
drawfillarc (145, maxy - 145, (145 div 2 + 3), (145 div 2 + 3), 90, 180, yellow)
drawfillarc (145, maxy - 145, (145 div 2 - 2), (145 div 2 - 2), 90, 180, grey)
%bottom left
drawfillarc (145, 145, 145, 145, 180, 360, grey)
drawfillarc (145, 145, (145 div 2 + 3), (145 div 2 + 3), 180, 270, yellow)
drawfillarc (145, 145, (145 div 2 - 2), (145 div 2 - 2), 180, 270, grey)
%bottom right
drawfillarc (maxx - 145, 145, 145, 145, 180, 360, grey)
drawfillarc (maxx - 145, 145, (145 div 2 + 3), (145 div 2 + 3), 270, 360, yellow)
drawfillarc (maxx - 145, 145, (145 div 2 - 2), (145 div 2 - 2), 270, 360, grey)
%dotted lines

% for i : 145 .. maxy - 145 by 20
%     drawfillbox ((145 div 2) - 2, i, (145 div 2) + 2, i + 10, yellow)
%     drawfillbox (maxx - (145 div 2) - 2, i, maxx - (145 div 2) + 2, i + 10, yellow)
% end for
% for i : 145 .. maxx - 145 by 20
%     drawfillbox (i, (145 div 2) - 2, i + 10, (145 div 2) + 2, yellow)
%     drawfillbox (i, maxy - (145 div 2) - 2, i + 10, maxy - (145 div 2) + 2, yellow)
% end for

process car1
    var pic : int := Pic.FileNew ("car1(0).jpg")
    var move : string (1)
    var move2 : string := ""
    var x, y, a : int
    x := (maxx div 2) - 155
    y := 0
    if pic = 0 then
        put "Unable to load JPEG: ", Error.LastMsg
        return
    end if
    Pic.Draw (pic, (maxx div 2) - 155, 0, picCopy)
    a := 0
    loop
        drawline (maxx div 2, 0, maxx div 2, 145, white)
        getch (move)
        if move = "w" then
            if a = 0 then
                x := x + 10
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 15 then
                x := x + 8
                y := y + 2
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 30 then
                x := x + 7
                y := y + 4
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 45 then
                x := x + 5
                y := y + 5
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 60 then
                x := x + 4
                y := y + 7
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 75 then
                x := x + 8
                y := y + 2
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 90 then
                y := y + 10
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 105 then
                x := x - 2
                y := y + 8
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 120 then
                x := x - 7
                y := y + 4
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 135 then
                x := x - 5
                y := y + 5
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 150 then
                x := x - 7
                y := y + 4
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 165 then
                x := x - 8
                y := y + 2
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 180 then
                x := x - 10
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 195 then
                x := x - 8
                y := y - 2
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 210 then
                x := x - 7
                y := y - 4
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 225 then
                x := x - 5
                y := y - 5
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 240 then
                x := x - 4
                y := y - 7
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 255 then
                x := x - 2
                y := y - 8
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 270 then
                y := y - 10
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 285 then
                x := x + 2
                y := y - 8
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 300 then
                x := x + 4
                y := y - 7
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 315 then
                x := x + 5
                y := y - 5
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 330 then
                x := x + 7
                y := y - 4
                Pic.Draw (pic, x, y, picCopy)
            elsif a = 355 then
                x := x + 8
                y := y - 2
                Pic.Draw (pic, x, y, picCopy)
            end if
        elsif move = "a" then
            if a + 15 = 360 then
                a := 0
            else
                a := a + 15
            end if
            pic := Pic.Rotate (pic, a, x, y)
            Pic.Draw (pic, x, y, picCopy)
        elsif move = "d" then
            if a - 15 = -15 then
                a := 355
            else
                a := a - 15
            end if
            pic := Pic.Rotate (pic, a, x, y)
            Pic.Draw (pic, x, y, picCopy)
        end if
    end loop
end car1
fork car1



car1(0).jpg
 Description:
heres the immage i used
 Filesize:  2.95 KB
 Viewed:  817 Time(s)

car1(0).jpg


Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Thu Jun 09, 2005 5:51 pm   Post subject: (No subject)

what don't you understand about Pic.Rotate()?
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  [ 2 Posts ]
Jump to:   


Style:  
Search: