Colliding Issue when actor changes image
DaGreatness
Member Posts: 82
So the issue i am having is, that i have an actor that collides with another actor which increases the health, also i have a charcter select screen where you choose the different actors. When I choose a different actor to play with from the select screen, the actor in the game with the different image does collide with the object but the health does not increase, it collides but does not increase the bar back up, but when i do it with the startup character which is the first image which is already on the actor it seems to work.
My actor has all the rules in one, so its just one actor with different images. Which i do not get why when the second image is changed, it collides with the item but it will never increase the health, is there something i am missing when you change images? with using the same actor and the actor rules?
Also, If i try to collide more than once, it still does not change the health bar ratio. I will insert the 2 actors rules down below.
Character Actor:
RULE
actor overlaps or collides with: actor of type->gaspump
If game.gaspower < 50
DO
Constrain Attribute: constrain game.gaspower to game.gaspower+10
HealthBar Actor:
RULE
If game.startgas is true
DO
Interpolate self.size.width to -1 for game.gaspower
Outside the rule
Constrain Attribute: constrain self.position.x to 13+(self.size.width/2)
gaspump Actor (this is what the actor will be colliding with to increase the health points):
RULE:
IF game.gaspower < 10
actor overlaps or collides with actor of type:gasPump
DO
constrain attribute: constrain game.gaspower to game.gaspower+10
RULE:
actor overlaps or collides with actor of type:body
DO
Timer: after 0 seconds Run to completion (Checked)
Destroy this actor
This is what i have, and you can recreate it to see
So if i have like 4 gaspumps they will all collide with the body, but will not increase the healthbar for some reason
My actor has all the rules in one, so its just one actor with different images. Which i do not get why when the second image is changed, it collides with the item but it will never increase the health, is there something i am missing when you change images? with using the same actor and the actor rules?
Also, If i try to collide more than once, it still does not change the health bar ratio. I will insert the 2 actors rules down below.
Character Actor:
RULE
actor overlaps or collides with: actor of type->gaspump
If game.gaspower < 50
DO
Constrain Attribute: constrain game.gaspower to game.gaspower+10
HealthBar Actor:
RULE
If game.startgas is true
DO
Interpolate self.size.width to -1 for game.gaspower
Outside the rule
Constrain Attribute: constrain self.position.x to 13+(self.size.width/2)
gaspump Actor (this is what the actor will be colliding with to increase the health points):
RULE:
IF game.gaspower < 10
actor overlaps or collides with actor of type:gasPump
DO
constrain attribute: constrain game.gaspower to game.gaspower+10
RULE:
actor overlaps or collides with actor of type:body
DO
Timer: after 0 seconds Run to completion (Checked)
Destroy this actor
This is what i have, and you can recreate it to see
So if i have like 4 gaspumps they will all collide with the body, but will not increase the healthbar for some reason
Comments
Edit: I struggled through it and I see what you're asking. In the future, part of the reason no one responded might be because it was hard to read.
Either post your collision rules or send a link to download your project file. Images should not affect collisions or other rules.
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User