Closed Stumpftopf closed 10 years ago
Looks like the defaults types and masks aren't resulting in collision (http://html5quintus.com/quintus/examples/collision/ is broken too) - I'll what changed
Breakout example doesn't work but the collision example does.
"http://html5quintus.com/quintus/examples/collision/ is broken too" Seems to work for me.... @cykod If i can help in anyway, you can send me a message, maybe the source from my game or something else.
+1 would be great if we can have this fixed asap ;)
Looking into the fix - this seems to just be a recently introduced problem when using a parent container with a scale - most games shouldn't be affected.
But the canvas is a parent container, so most games should be affected. Or am I wrong? Not sure...
No, canvas isn't a container - only if you explicitly use Q.insert with a parent. Running a git-bisect this weekend to figure out where the problem started.
Sorry, dude. It's still broken... Only works correct with: .setup({ maximize: true }) but not if i set it like this: .setup({width: 800, // Set the default width to 800 pixels height: 600, // Set the default height to 600 pixels scaleToFit: false // Scale the game to fit the screen of the player's device })
What if you delete the scaleToFit
option?
[EDIT] My bad, it's false
so it shouldn't be a problem anyway…
@Stumpftopf - ?
Just changed "breakout.js" line 6 in the latest master to read:
.setup({ width:800, height: 600, scaleToFit: false })
And it works just fine - the background doesn't match the game but all the collisions are correct. Can you set Q.debug=true
and take a screen shot of what you're seeing?
If have the same bug on the breakout demo: the balls goes through the bricks without deviating nor colliding.
Maybe it's a simple matter of collisionLayer
?
@cykod @viki53 I think the problem isn't the collisionLayer, cause the first time, the icon hits the paddle (x: 0 ) the collision works:
But if x is bigger then the width of the paddle, collision don't work:
The collision points looks good to me, i think the problem is maybe a wrong scale of the "world" or matrix.
Here is the source of my little game: https://bitbucket.org/benjamin_schneider/dropgame-js
I hope it can help to fix that.
@Stumpftopf - No, you're just colliding with the background on each frame so it's not colliding with the player. Set the type of the background to 0 and you should be fine. The fact that there's a collision on each frame should have been a tip off.
Q.Sprite.extend("Background",{
init: function(p) {
this._super(p, {
x: Q.width/2,
y: Q.height/2,
type: 0, // if you don't set the type to zero the icon will collide with it on each frame.
asset: "background.png"
});
}
});
@cykod Now it works! Thx.
the breakout example in the quintus website has to be updated.
I think I have a similar issue with collision detection. My Player sprite and enemy sprite does collide initially and then both just pass through without any collision. I also tried setting the Background sprite to type 0, but still the issue persists.
Note :- Earlier this issue was occuring on my desktop as well, but now it occurs on mobile devices only.
Hi, i'm working on a litte game. The player just catches some symbols who are falling down from the top to to bottom with a paddle. Now the problem is, the collision will detect only the first time, then I delete the object with this.destroy(); after that i add a new symbol object with this.stage.insert(new Q.Icon()); this works fine, but if the player now tries to catch that new object, the collision won't be triggered.
I am using Chrome: Version 35.0.1916.153 and also tried to use firefox, but same problem.
The breakout example, has the same problem: http://html5quintus.com/quintus/examples/breakout/