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

Username:   Password: 
 RegisterRegister   
 Rotate Picture HELP!
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Masta_911




PostPosted: 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



Game.rar
 Description:
this iz da file and the pics needed to use it

Download
 Filename:  Game.rar
 Filesize:  15.04 KB
 Downloaded:  71 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
Masta_911




PostPosted: 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
Clayton




PostPosted: 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.
Masta_911




PostPosted: 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
Clayton




PostPosted: 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
octopi




PostPosted: 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.
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  [ 6 Posts ]
Jump to:   


Style:  
Search: