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

Player Image got removed #4

Open
adesst opened this issue Mar 28, 2013 · 2 comments
Open

Player Image got removed #4

adesst opened this issue Mar 28, 2013 · 2 comments

Comments

@adesst
Copy link

adesst commented Mar 28, 2013

At map1 if the player died and got whip. The whip will stay with the player after the level
restart. The problem is when the player got another whip, the player image got removed.

What i found:

in sprite.js line 113 :
+++ document.getElementById("debug").innerHTML = current_idx + ' ' + this.composition;

in index.html line 30:
+++ <div id="debug"></div>

Player has no whip and is now collide with whip:
Expected:
1 player, whip
actual:
1 player, whip

Player has whip and collide with whip:
Expected:
1 player, whip
actual:
0 whip, whip

And the player image got removed

@adesst
Copy link
Author

adesst commented Mar 28, 2013

My bad just got the cure 👯

in character.js
@ equipWep : function(wepString):
--- this.setCompositionOrder(wep.name, this.name, true);
+++ this.setCompositionOrder(wep.name, self.name, true);

@ equipGear : function(gearString):
--- this.setCompositionOrder(gear.name, this.name, true);
+++ this.setCompositionOrder(gear.name, self.name, true);

Hope it helps.

@jroblak
Copy link
Owner

jroblak commented Apr 15, 2013

Thanks! I didn't even check for that situation! It's a result of hacking in Jason's sprite composition system without enough testing, but your solution looks good! If you want to submit a pull request with that change, I'd be happy to add it.

There is a similar problem with the jetpack (just that if a player collects it then dies, they still have it). At some point I should probably code something that remove items from that level on death, but I've moved on from this project (for now). One day!

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

No branches or pull requests

2 participants