Computer Science Canada

Rotate Picture HELP!

Author:  Masta_911 [ Mon Jan 08, 2007 6:50 pm ]
Post subject:  Rotate Picture HELP!

Hey guyz i wrote this code and wanted sum help with it. i jus started my game so... does ny 1 here know how to move the plane in the direction that its facing after its done rotating if u do plzz help!

p.s. after like 1 min of runing the code it give u dis error
"Cannot Allocate Item. Out of id numbers (max 1000).

does ny 1 noe y or how to fix this error

ny help will be appriciated

Author:  Masta_911 [ Mon Jan 08, 2007 7:01 pm ]
Post subject:  Re: Rotate Picture HELP!

if anyone want 2 insert their own pic da code is dis

View.Set ("offscreenonly")
colourback (7)

var x, y : int := 100
var yo : int := Pic.FileNew ("space.jpg")
var yo2 : int
var z : int := 0
var chars : array char of boolean
var x1 : int := 60
var y1 : int := 60


loop
yo2 := Pic.Rotate (yo, z, x1, y1)
Input.KeyDown (chars)

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

if chars (KEY_RIGHT_ARROW) then
Pic.Draw (yo2, x, y, picMerge)
z := z - 5
end if

if chars (KEY_LEFT_ARROW) then
Pic.Draw (yo2, x, y, picMerge)
z := z + 5
end if

if chars (KEY_DOWN_ARROW) then
y := y - 5

end if
Pic.Draw (yo2, x, y, picMerge)

if z = 900 then
z := 5
end if
colour (0)
put z
put x1
put y1
delay (10)
View.Update
cls
end loop

Plzzz help

Author:  Clayton [ Mon Jan 08, 2007 7:15 pm ]
Post subject:  Re: Rotate Picture HELP!

first, please use [code] tags when you post code. Second, the problem is that you are creating too many pictures (1000 is the limit). To stop this, either initialize a set number of pictures facing several different angles at the beginning, or Pic.Free() a picture you are done with after using it.

Author:  Masta_911 [ Mon Jan 08, 2007 7:32 pm ]
Post subject:  RE:Rotate Picture HELP!

thanks i got the error part fixed buh does ANY ONE know how to move the plane in the direction its facing after rotating using the forward key


thanks again

Author:  Clayton [ Mon Jan 08, 2007 7:35 pm ]
Post subject:  Re: Rotate Picture HELP!

First off, you're posting in the completely wrong forum, you should've posted this question in [Turing Help], not [PHP Tutorials]. Second, you will need to know trig to find the angles that you need to move at. Use SOH|CAH|TOA

Author:  octopi [ Tue Jan 09, 2007 2:48 am ]
Post subject:  Re: Rotate Picture HELP!

Moved to turing help, from php tutorials.

Please make sure to post a topic in the correct forum.


: