Field Of Play Question

Need help defining game board. I will be defining a series of images that i will need to overlay bounderies.

In the picture above the bounderies are not square there is some perspective. So i would need to keep the playing object within the field of play.

Please post the code to help me achieve this..

thanks
Anthony

I'm afraid you're basically asking us to write the core of your game for you. I'm not up for it, but I don't know about anyone else...

I am confused.. I am new so please accept my apology if I am over simplifying what i am asking for...

I want 4 connected lines... 2 straight(top and bottom) and 2 diagonal (left and right) the rest i will code..

Then you should probably be drawing them using the vector graphics:

http://developer.anscamobile.com/reference/factory-functions

If anyone is interested this is what I came up with... If you know of a better way or see a mistake in my code, please let me know.

I would appreciate not being bashed if I am way off base since this only day 3 of my experience with Corona..

The key seemed to be: :rotate( value )

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
local topWall = display.newRect(10, 10, 300, 3)
topWall.x = display.contentWidth / 2
 
local bottomWall = display.newRect(0, display.contentHeight -10, 730, 3)
bottomWall.x = display.contentWidth / 2
 
local leftWall = display.newRect(125, 0, 3, display.contentHeight)
leftWall:rotate( 12 )
 
local rightWall = display.newRect(display.contentWidth -130, 0, 3, display.contentHeight)
rightWall:rotate( -12 )
 
physics.addBody(leftWall, "static", 12.5)
physics.addBody(topWall, "static", 12.5)
physics.addBody(rightWall, "static", 12.5)
physics.addBody(bottomWall, "static", 12.5)
views:1498 update:2011/10/4 8:06:35
corona forums © 2003-2011