19 lines
398 B
TypeScript
19 lines
398 B
TypeScript
import { _decorator, Component, Node } from 'cc';
|
|
const { ccclass, property } = _decorator;
|
|
|
|
@ccclass('move')
|
|
export class move extends Component {
|
|
start() {
|
|
|
|
}
|
|
|
|
update(dt: number) {
|
|
this.node.setPosition(this.node.position.x+dt*15,this.node.position.y)
|
|
if(this.node.position.x >= 1700){
|
|
this.node.setPosition(-1700,this.node.position.y)
|
|
}
|
|
}
|
|
}
|
|
|
|
|