Game Development Reference
In-Depth Information
dimension.set(0.25f, 0.5f);
regCarrot = Assets.instance.levelDecoration.carrot;
// Set bounding box for collision detection
bounds.set(0, 0, dimension.x, dimension.y);
origin.set(dimension.x / 2, dimension.y / 2);
}
public void render (SpriteBatch batch) {
TextureRegion reg = null;
reg = regCarrot;
batch.draw(reg.getTexture(), position.x - origin.x,
position.y - origin.y, origin.x, origin.y, dimension.x,
dimension.y, scale.x, scale.y, rotation, reg.getRegionX(),
reg.getRegionY(), reg.getRegionWidth(),
reg.getRegionHeight(), false, false);
}
}
Adding the goal game object
The following goal game object will be used to mark the end of a level:
 
Search WWH ::




Custom Search