Change character+animations when item is collected.

This forum is currently in read-only mode.
From the Asset Store
A game with 3D terrain, realistic water and various 3D objects.
  • I cant seem for the life of me to figure this one out. It seems like it would be so simple yet its not Heres what i need help on. In my game, the character starts off with nothing. As u explore the terrain, u find powerups to help advance u. Its in the vein of Metroid and Castlevania SOTN. I need to make it that when u get the new item (in this case, a gun) ur sprite changes to the one with a gun i have made up. Ive tried EVERYTHING and cant seem to get it to work right. Heres the CAP. Please help me. Much appreciated. Thanks.

    http://www.mediafire.com/?sharekey=0c61fdebdb549b505bf1f12f1ff3f30ae04e75f6e8ebb871

  • This is how I would do it, for each different character type (no gun, with gun etc.) give them all the same family. Then replace all your coding for charlie with family object, which will make it so that all of the character sprites are doing the same thing.

    like this (i replaced 'charlie' with the family 'friedly'):

    <img src="http://dl.getdropbox.com/u/1024727/images/heysd.JPG">

    then you just need some events (maybe a global variable)

    when character = 0 then make charlie visible and charlie gun invisible

    character = 1 make charlie gun visible and charlie invisible

    that's just a way to do it I guess.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks for the reply. I did what u suggested but failed... I donno if if it just didnt work (cause it sounds like it should work) or if i messed up somewhere. Heres the CAP of what i did. Maybe someone can fix it or point me in the right direction. Thanks again.

    http://www.mediafire.com/?sharekey=0c61fdebdb549b505bf1f12f1ff3f30ae04e75f6e8ebb871

  • This is way over my head, I tried to make it so when charlie touches "Gem" his sprite is destroyed & Charlie W/ gun is created where "Player" is. But that doesn't work because you have Player and Charlie in a container so they're both destroyed when I just try to destroy the Charlie sprite. And I can't uncontainer them because a lot of the coding you did for it needs it. I never use containers because this kind of shit happens and you have to start all over. The easiest thing to do would be to create a sprite called "gun" and when weapon=1 set "gun's" position to charlies hand so it looks like he's holding it.

  • I had trouble figuring this out at first, but then fired up your game in the debugger to see what was going on. On startup, I see that 1 instance of Charlie sprite is created, but no instances of Charlie_Gun is created. That is because Charlie is in a container with the player (red square), but Charlie_Gun is not.

    So the solution is to add Charlier_Gun to the player container. And everything works!!! you still need to fix some shooting issues, but the game is looking good!!

  • I had trouble figuring this out at first, but then fired up your game in the debugger to see what was going on. On startup, I see that 1 instance of Charlie sprite is created, but no instances of Charlie_Gun is created. That is because Charlie is in a container with the player (red square), but Charlie_Gun is not.

    So the solution is to add Charlier_Gun to the player container. And everything works!!! you still need to fix some shooting issues, but the game is looking good!!

    THANK U! Ur the man! Something so simple overlooked. Ur a life saver man, thanks alot again. I really appreciate it. Thanks to all the other too for helping. This community is great.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)