Tutorials Broken?

Tutorials Broken?
0

#1

Hello,

I’ve been attempting to learn Cocos Creator because there aren’t many JavaScript engines out there that are a total package. Maybe 1 or 2. I really want to use it because I can use pure JavaScript, the language I’m learning. I just discovered the tutorial was broken, and even after trying to fix it I’ve gotten nowhere. There’s not much material out there for learning this engine - maybe only a couple of videos on YouTube, but surprisingly little for what looks like it should be a solid project. If I can’t even get past the first tutorial on the website, how am I supposed to learn this engine? It seems the tutorials are based on an older version of the engine. Should I just avoid the 2.1 series of the engine until hopefully the documentation/tutorials catch up with the pace of development?


#2

Can you tell me what is broken please.


#3

The tutorial requires this code:

const {ccclass, property} = cc._decorator;
@ccclass
export default class Mover extends cc.Component {
update (dt) {

    this.node.setPositionX(this.node.position.x -= 100 * dt);
    if(this.node.position.x < -(this.node.parent.width/2) - this.node.width/2)
        this.node.setPositionX(this.node.parent.width/2 + this.node.width/2);
} 

}

setPositionX seems to have been changed, I removed the ‘X’ which cleared the errors, but when I run the project all I get is a black screen.

This is what I changed the code to:

update (dt) {
this.node.setPosition(this.node.position.x -= 100 * dt);
if(this.node.position.x < (this.node.parent.width/2) - this.node.width/2 )
this.node.setPosition(this.node.parent.width/2 + this.node.width/2)

I can run it in the browser with no errors, but I only get a black screen.


#4

What webpage are you getting this from?


#5

on the front page of the cocos creator website, I go to learn, and then crash course. It looks like it redirects to devga.me


#6

#7

Lol sorry. Which website :slight_smile: just post the base url.


#8

http://www.cocos2d-x.org/learn


#9

Oh I see. These tutorials are made by others. They aren’t the tutorials we put out. http://docs.cocos2d-x.org/creator/2.1/manual/en/getting-started/


#10

Thank you, book marked. I’ll go through these tonight. Thank you :slight_smile: