Rotate Picture HELP!
Author |
Message |
Masta_911
|
Posted: 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
Description: |
this iz da file and the pics needed to use it |
|
![](http://compsci.ca/v3/pafiledb/images/icons/clip.gif) Download |
Filename: |
Game.rar |
Filesize: |
15.04 KB |
Downloaded: |
71 Time(s) |
|
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
Masta_911
|
Posted: 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
|
|
|
|
|
![](images/spacer.gif) |
Clayton
![](http://compsci.ca/v3/uploads/user_avatars/1718239683472e5c8d7e617.jpg)
|
Posted: 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.
|
|
|
|
|
![](images/spacer.gif) |
Masta_911
|
Posted: 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
|
|
|
|
|
![](images/spacer.gif) |
Clayton
![](http://compsci.ca/v3/uploads/user_avatars/1718239683472e5c8d7e617.jpg)
|
Posted: 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
|
|
|
|
|
![](images/spacer.gif) |
octopi
![](http://compsci.ca/v3/uploads/user_avatars/1246682444a1aa25749124.gif)
|
Posted: 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.
|
|
|
|
|
![](images/spacer.gif) |
|
|