Skip to content
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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

StaticUpdate #2

wants to merge 4 commits into from

Conversation

ca1vinat3
Copy link
Collaborator

spawns three buses and mailman on start

spawns three buses and mailman on start
search now dissmisses window and scrolls to top to show our static setup
@@ -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);
Copy link
Collaborator

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),
Copy link
Collaborator

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

this.cameras.main.scrollY = this.myMainCameraPosition;
}}, 20);

this.mybus = new Bus(this);
Copy link
Collaborator

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

//this.busInsideSingle(this.mybus);
this.mybus.txsOverride = true;
//this.mybus.tx.length = 4;
this.mybus.loaded = 4 ;
Copy link
Collaborator

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

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);
Copy link
Collaborator

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

this.mySecondBus.text3.setText("+0Wei");
this.mySecondBus.logo.setScale(0.3);

this.myThirdBus = new Bus(this);
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants