fix two typos in comments in platformer example
This commit is contained in:
parent
bfa01ad494
commit
a922379753
|
@ -116,7 +116,7 @@ func (gp *gopherPhys) update(dt float64, ctrl pixel.Vec, platforms []platform) {
|
||||||
gp.vel += pixel.Y(gp.gravity).Scaled(dt)
|
gp.vel += pixel.Y(gp.gravity).Scaled(dt)
|
||||||
gp.rect = gp.rect.Moved(gp.vel.Scaled(dt))
|
gp.rect = gp.rect.Moved(gp.vel.Scaled(dt))
|
||||||
|
|
||||||
// check collisions agains each platform
|
// check collisions against each platform
|
||||||
gp.ground = false
|
gp.ground = false
|
||||||
if gp.vel.Y() <= 0 {
|
if gp.vel.Y() <= 0 {
|
||||||
for _, p := range platforms {
|
for _, p := range platforms {
|
||||||
|
@ -213,7 +213,7 @@ func (ga *gopherAnim) draw(t pixel.Target, phys *gopherPhys) {
|
||||||
if ga.sprite == nil {
|
if ga.sprite == nil {
|
||||||
ga.sprite = pixel.NewSprite(nil, pixel.Rect{})
|
ga.sprite = pixel.NewSprite(nil, pixel.Rect{})
|
||||||
}
|
}
|
||||||
// draw the correct frame with the correct positon and direction
|
// draw the correct frame with the correct position and direction
|
||||||
ga.sprite.Set(ga.sheet, ga.frame)
|
ga.sprite.Set(ga.sheet, ga.frame)
|
||||||
ga.sprite.SetMatrix(pixel.IM.
|
ga.sprite.SetMatrix(pixel.IM.
|
||||||
ScaledXY(0, pixel.V(
|
ScaledXY(0, pixel.V(
|
||||||
|
|
Loading…
Reference in New Issue