dd
This commit is contained in:
18
assets/script/game/map/move.ts
Normal file
18
assets/script/game/map/move.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user