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

Username:   Password: 
 RegisterRegister   
 Collision Detection or something of that sort
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Masta_911




PostPosted: Tue Jan 23, 2007 10:22 pm   Post subject: Collision Detection or something of that sort

Ok so the problem is i have two pictures rotating in a loop and i want to detect when they collide basically. i went through the circle collision tutorial..it just went rite over my head.. didnt get it.. so if someone could guide me thanks.. heres the code..
[code]
setscreen ("screen:max;max")
View.Set ("offscreenonly")
var x, y : int := 100
var x2, y2 : int := 300
var pic1 : int := Pic.FileNew ("pic1.bmp")
var pic2 : int := Pic.FileNew ("pic2.bmp")
var rotate1 : int
var rotate2 : int
var rot : int := 10


loop
rotate1 := Pic.Rotate (pic1, rot, 10, 10)
rotate2 := Pic.Rotate (pic2, rot, 10, 10)
Pic.Draw (rotate1, x, y, picMerge)
Pic.Draw (rotate2, x2, y2, picMerge)
x := x + 5
y := y + 5
x2 := x2 + 5
y2 := y2 + 5
rot := rot + 10
Pic.Free (rotate1)
Pic.Free (rotate2)
View.Update
cls
end loop
[code]
i just made this quickly to show you guys what i am trying to do..i want to know when the pic1 and pic2 collide..if you want to know why iam trying to do this is because i am making a space game which is due tomarroe and i hav astroids moving around the screen and boucing off the ends of the screen and yaaa i almost forgot i to tell you guys the two pics will go rite off the screen i didnt add the code wher it bounces iff off the wall.. i made the code jus to make it clear for you guys to help.. and ya i was saying i want to know when the astroid(pic1) hits the plane(pic2) so i can decrease the helth of the plane.. nd by da way my game is comming along very good and thts thanks to your help..
plz help as soon as you can thknX[/code]
Sponsor
Sponsor
Sponsor
sponsor
Masta_911




PostPosted: Tue Jan 23, 2007 10:24 pm   Post subject: RE:Collision Detection or something of that sort

i know its against the rules to double post but i forgot to add that the picture pixels are 130*130 and 100*100 thought that would be important and iam NOT telling anyone to do my code for me just want assistance
sry again
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  [ 2 Posts ]
Jump to:   


Style:  
Search: