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

Username:   Password: 
 RegisterRegister   
 Pic.Rotate Help
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
jeo77




PostPosted: Tue Dec 13, 2005 9:00 am   Post subject: Pic.Rotate Help

Hey, just wanted to say this before I pleed for help - great forums you guys have got running here, come in real handy when you get stuck and are sitting here cursing at the monitor. Heh.

Anyways, Im making a small artillery game, and im trying to figure out how to rotate the turret of the tank, it's a seperate picture, and I can get it to rotate, but it rotates on a wierd pivot point, I need the pivot point on the bottom center of the turret, any ideas?

This is what I got so far,

code:

View.Set ("graphics:1000;700,nobuttonbar")


var player1turret : int
player1turret := Pic.FileNew ("barrel.jpg")




var p1turretmove : string (1)
var p1turretangle : int
p1turretangle := 90
loop
    getch (p1turretmove)
    if ord (p1turretmove) = 203 then
        p1turretangle := p1turretangle - 10

        var p1turretleft : int := Pic.Rotate (player1turret, p1turretangle, 15, 12)
        Pic.Draw (p1turretleft, 100, 100, picCopy)

    elsif
            ord (p1turretmove) = 205 then
        p1turretangle := p1turretangle + 10

        var p1turretleft : int := Pic.Rotate (player1turret, p1turretangle, 15, 12)
        Pic.Draw (p1turretleft, 100, 100, picCopy)


    end if

end loop
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Tue Dec 13, 2005 10:10 am   Post subject: (No subject)

well
code:

Pic.Rotate (picID, angle, x, y : int) : int

Where x,y is the pivot point relative to the bottom left of the image. If it rotates weirdly, try adjusting those values.
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
do_pete




PostPosted: Tue Dec 13, 2005 11:07 am   Post subject: (No subject)

Yes and pre rotate your pictures and store them in an array, It'll make it go much faster on slower computers
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  [ 3 Posts ]
Jump to:   


Style:  
Search: