This site requires JavaScript, please enable it in your browser!
Greenfoot back
cosmophobia
cosmophobia wrote ...

2012/12/25

Smaller field borders that World's are being defined

cosmophobia cosmophobia

2012/12/25

#
Hi, I have a World that hosts a football field which is a bit smaller than the actual size of my World (600x400). I am not really sure how to make the offset to recognize the football borders correctly so that my ball only goes as far as the football field borders go. If I could successfully recognize the correct coordinates of my football field, I would eventually manage to set the borders correctly. Can anyone help me understand how to use the offset (or to measure the field coordinates)? Any help would be highly appreciated. Best Regards / Rosen
cosmophobia cosmophobia

2012/12/25

#
Can I use "AtWorldEdge()" method to define the borders of the field as the borders of my World?
nooby123 nooby123

2012/12/25

#
If you know the size of the football field(by pixel), and if the football field is in the center, then the right end border is (300 + (length of the foot ball field in pixels/2)) and the left end border is (300 - (length of the foot ball field in pixels/2)).
cosmophobia cosmophobia

2012/12/25

#
Thank you nooby123, I will give it a try right away. Once again, thanks for your prompt reply!
You need to login to post a reply.