added sphere bounce over the map borders
This commit is contained in:
@@ -26,7 +26,7 @@ func (position *Position) Update(x, y int, size ...int) {
|
||||
position.Rect = &rect
|
||||
}
|
||||
|
||||
func NewPosition(point *image.Point, cellsize int) *Position {
|
||||
func NewPosition(point image.Point, cellsize int) *Position {
|
||||
position := &Position{}
|
||||
position.Update(point.X*cellsize, point.Y*cellsize, cellsize)
|
||||
return position
|
||||
@@ -39,8 +39,8 @@ func (position *Position) GetMoved(velosity *Velocity) *Position {
|
||||
return pos
|
||||
}
|
||||
|
||||
func (position *Position) Point() *image.Point {
|
||||
return &image.Point{position.X / position.Cellsize, position.Y / position.Cellsize}
|
||||
func (position *Position) Point() image.Point {
|
||||
return image.Point{position.X / position.Cellsize, position.Y / position.Cellsize}
|
||||
}
|
||||
|
||||
func (position *Position) Left() int {
|
||||
|
||||
Reference in New Issue
Block a user