소스 검색

Update car.md

Björn Ritzl 1 년 전
부모
커밋
68649554a2
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      docs/en/tutorials/car.md

+ 3 - 3
docs/en/tutorials/car.md

@@ -299,7 +299,7 @@ function update(self, dt)
 	...
   -- Calculate new velocity based on current acceleration
 	self.velocity = self.velocity + self.acceleration * dt
-  ...
+	...
 end
 ```
 
@@ -310,11 +310,11 @@ function update(self, dt)
 	local speed = vmath.length_sqr(self.velocity)
 
 	-- Apply drag
-	self.acceleration = self.acceleration - speed * self.direction * drag
+	self.acceleration = self.acceleration - speed * self.velocity * drag
 
 	-- Stop if we are already slow enough
 	if speed < 0.5 then self.velocity = vmath.vector3(0) end
-  ...
+	...
 end
 ```