obiot/melonJS — Issue #22: Issues in Tutorial
Author: austynmahoney
Created: 2011-10-17 14:06:33+00:00
State: open

There are some issues I encountered in the tutorial that caused quite a few headaches.

The first one I came upon was a syntax error in the enemy Entity code. There is a >= with a space between the > and =. The typo is in the update function in the else...if.

```java
// manage the enemy movement
update: function() {
// ... code before

if (this.alive) {
if (this.walkLeft && this.pos.x < = this.startX) {
this.walkLeft = false;
} else if (!this.walkLeft && this.pos.x > = this.endX) { //****** > = should be >= ******
this.walkLeft = true;
}

//... code after
}
```

The next issue I came across was the lack of explanation of Objects and Entities. I think just a couple lines explaining how to add and edit an entity to the object layer would make it much easier to follow for a newcomer to the engine. I got lost here for a while and had to backtrack to figure out where I went wrong.

Thanks!