Collision and score problem

Hi there,

I have a problem and I was wondering if anyone could help me with it.
Basically in my game I have a real attribute as a score and I also have an actor that if it the main actor collides with that actor, he dies and the game ends.
So the problem I'm facing is, every time the main actor collides with the actor that kills him, the real score attribute score stops working even if I restart the game.

I don't know if this is a bug, but can someone please provide me with advise on how to solve this? As in when I restart the game, the real score attribute continues to work like it did before. I have enemies in my game and when they collide with my actor, it doesn't stop the real score attribute from working, but the collision actor stops it from working which sucks lol. I have been trying to solve this for over 2hours now and I still can't get it to work.

Any help out there?

Comments

  • KevinCrossKevinCross London, UKMember Posts: 1,894
    Please attach a screenshot of the behavior/rule that has the problem, and is there a particular reason why you've chosen real for the score and not integer?
  • Gamer1992Gamer1992 Member Posts: 83
    @KevinCross hey Kevin, nice to see you again. And I would of posted a screen shot of my rules but I don't think its going to make sense to you the way I've done it.

    And the reason am using real for score instead of an integer is because my game is an endless runner game therefore I'm using the real attribute as a score as a way of displaying the distance travel. I don't think I can use an integer for that, or can I?
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    There's no real problem with using real, just thought it was strange tis' all.

    The problem with not being able to see a screenshot of the affected code is we've no idea what you're doing with the score and what you've got on the collision actor to make it stop. You've just said it's stops working when collisions happen
  • Gamer1992Gamer1992 Member Posts: 83
    @KevinCross alright i will post a picture up now
  • Gamer1992Gamer1992 Member Posts: 83
    @KevinCross This is the rule in my player which collides with actor that kills him.
    image

    This is the rule in my background actor which contains and update the score.
    image

    This is my actor that kills my player, as you can see, there is no rule in that one because I have set its collision rule in the player actor.
    image

    so basically when I first open my game, everything works excellent but as soon as I collide the actor that destroys my player, the score stops working even if I restart my game by clicking the restart button
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    Ah seen, and are you resetting game.PlayerDead back to false when you press your restart button?
  • Gamer1992Gamer1992 Member Posts: 83
    @KevinCross you sir are genius!!!! You've helped me once again thank you so much. Basically I forgot to change the playerdead back to false in the restart button screen as you've indicated. Now it works. And I can finally submit my first game to apple. YAAAY lol :D :)>- .

    I have one question though. My game is currently for ipad and I wanted to make it universal for iPhone 5 and later. And I understand I have to use the universal binary codes which I have done and it works great. However, the physics of the game when I test it on my iphone is different compared to when I test it on my iPad. on my ipad, the physics is exactly what I want it to be, but on my iphone its not. Therefore instead of doing a universal build, I was thinking of making a seperate version for the iphone so I can manually tweak the physics for the iphone one. My game is just a simple endless runner game so it will only take like 2 days to resize or my graphics and stuff for the iphone.
    So what's your opinion on this? should I make a seperate iphone version or should I just use the universal build process?
  • KevinCrossKevinCross London, UKMember Posts: 1,894
    @Gamer1992 you're welcome. Thanks for uploading the screenshots, it saved endless posts of guessing :) and congrats on finishing up your first game. I haven't got an iPad but if you release it on the phone let me know and I might grab a copy.

    As for the universal build, I won't lie, the whole thing confuses me a little as there seems to be dozens of different ways to approach it. For my next one I'm creating a scene for each aspect ratio and will use stretch when it's finally released in the next public build.

    Stretch and a scene for each aspect ratio allows me to position actors appropriately without them distorting when they stretch. That's the theory anyway. It seems to be working ok.

    Someone else might be able to give advice on how you should approach it.
  • Gamer1992Gamer1992 Member Posts: 83
    @KevinCross haha yeah the screenshot helped a lot. And alright thank you for the advise. For now, I will just build a separate version for the iphone just to be on the safe side.
Sign In or Register to comment.