Sunday, 21 December 2008

Tutorial Week 7

Extending RoadRun


// draw the top roadside colour has been changed
osg.setColor(0x00aaaaaa);

// draw the middle safety strip had been changed
osg.setColor(0x00666666);
osg.fillRect(0, y-2, getWidth(), 2);
osg.setColor(0x00209020);
osg.fillRect(0, y, getWidth(), laneHeight); y+= laneHeight;
osg.setColor(0x00666666);
osg.fillRect(0, y - 2, getWidth(), 2);

laneHeight = ((heightMinusStatus) / 15); - this add another 7 line

wombat = new WombatActor(this, getWidth() / 2, getLaneYPos(14));

Wombat class:

//move within 15 lines

if (y > gameScreen.getLaneYPos(14))
y = gameScreen.getLaneYPos(14);


No comments: