Pic.Rotate Help
Author |
Message |
jeo77
|
Posted: 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
|
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Tony
![](http://wiki.compsci.ca/images/f/f4/OniTony.gif)
|
Posted: 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. |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
![](images/spacer.gif) |
do_pete
![](http://i38.photobucket.com/albums/e112/do_pete/1943.gif)
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
|
|