-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
StaticUpdate #2
base: main
Are you sure you want to change the base?
StaticUpdate #2
Conversation
spawns three buses and mailman on start
@@ -17,6 +17,52 @@ const Person = new Phaser.Class({ | |||
}, | |||
}); | |||
|
|||
Person.prototype.createPath = function(points){ | |||
this.points = points; | |||
this.curve = new Phaser.Curves.Spline(this.points); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let sp= this.curve.getPoint(0);
this.x = sp.x;
this.y = sp.y
avoid calling the getpoint function twice
@@ -385,15 +385,15 @@ Bus.prototype.leaveTween = function () { | |||
|
|||
this.movingTween = this.scene.add.tween({ | |||
targets: [this], | |||
y: toRes(-500 - this.busHeight), | |||
y: toRes(800), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we not use some percentage of the screen here? instead of 800
src/components/streets/ethereum.js
Outdated
this.cameras.main.scrollY = this.myMainCameraPosition; | ||
}}, 20); | ||
|
||
this.mybus = new Bus(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.mybus = new Bus(this);
this.mybus.y = 200;
this.mybus.text1.setText("#20975174");
this.mybus.text2.setText("2Gwei");
this.mybus.text3.setText("+0Wei");
this code looks like we can create a function for creating bus as we are using the same code on 149 only with different parameterts
src/components/streets/ethereum.js
Outdated
//this.busInsideSingle(this.mybus); | ||
this.mybus.txsOverride = true; | ||
//this.mybus.tx.length = 4; | ||
this.mybus.loaded = 4 ; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.mybus.loaded = 4 ;
this.mymailman = this.add.image(this.mybus.x,this.mybus.y-50,getSheetKey("person-"),"mailman-0.png").setDepth(100).setScale(0.5);
this.mypersonman = this.add.image(this.mybus.x-20,this.mybus.y-50,getSheetKey("person-"),"person-59.png").setDepth(100).setScale(0.5);
this.mysecondpersonman = this.add.image(this.mybus.x+40,this.mybus.y-50,getSheetKey("person-"),"bear-0.png").setDepth(100).setScale(0.5);
this can also be having a functon created
src/components/streets/ethereum.js
Outdated
this.mysecondpersonman1 = this.add.image(this.mybus.x+20,this.mybus.y-28,getSheetKey("person-"),"bear-0.png").setDepth(100).setScale(0.5); | ||
//this.myPeopleInBus = this.scene.add.image(this.mybus.x,this.mybus.y, "myPeopleInBus").setOrigin(0, 0).setDepth(11); | ||
|
||
this.mySecondBus = new Bus(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can create one single function for this
src/components/streets/ethereum.js
Outdated
this.mySecondBus.text3.setText("+0Wei"); | ||
this.mySecondBus.logo.setScale(0.3); | ||
|
||
this.myThirdBus = new Bus(this); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can create a single function
spawns three buses and mailman on start