Beispiel #1
0
// Draws the motion's active bitmap at the given coordinates
func (m *Motion) Draw(screen *sdl.Surface, x, y int) {
	if m == nil {
		return
	} // don't blit if the tile is nil.
	active := m.active
	if active == nil {
		return
	} // don't blit if no frame there yet.
	screen.Blit(active, x, y)
}
Beispiel #2
0
// Draws the layer to the screen using x and y as the corner coordinates
func (l *Layer) Draw(screen *sdl.Surface, x, y int) {
	cam := &Camera{Offset{x, y}, screen.W(), screen.H()}
	l.DrawCamera(screen, cam)
}