地图修改

This commit is contained in:
2025-07-28 00:14:20 +08:00
parent 4bd2e5566a
commit 48eaa6d1ad
39 changed files with 6805 additions and 2484 deletions

View File

@@ -1,16 +1,22 @@
import { _decorator, Component, Node } from 'cc';
import { _decorator, CCInteger, Component, Node } from 'cc';
const { ccclass, property } = _decorator;
@ccclass('move')
export class move extends Component {
@property({ type: CCInteger })
speed:number=2
@property({ type: CCInteger })
maxX:number=640
@property({ type: CCInteger })
minX:number=-640
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)
this.node.setPosition(this.node.position.x+dt*this.speed,this.node.position.y)
if(this.node.position.x >= this.maxX){
this.node.setPosition(this.minX,this.node.position.y)
}
}
}