Problem with card game

0 favourites
  • 3 posts
From the Asset Store
Template for trading card game, fully documented in comments and video
  • Hello everybody, I am developing a card game and I have a problem, maybe trivial: I created some spawner objects that generate themselves an object (let's call it "Global") that has an animation with several frames. Global object is the entire hand of a player.

    I need to create the following condition: if the Global object (that is the player's hand) has some certain frames (e.g. frame 3, 5 and 7), an event will activate.

    So, I set the condition:

    (Global) Animation frame = 3 & 5 & 7

    The problem is here, because the game recognizes the first frame (3) and the event is already active, while I need the event to be activated ONLY if there are ALL 3 frames, not only the first.

    How can I fix this? Thanks in advance! (and sorry for my bad english)

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Instead of "Global" how about we call it "Card" since that is more descriptive and less confusing since global already has uses in C2.

    And just to restate the problem: you want to know when three of the cards have those 3 different animation frames.

    Do to picking we can't just have multiple "compare animation frame" conditions in one event and have it work like we want. We can make make a function to do this though as it doesn't affect picking.

    So you could do something like this:

    On function "hasCard"

    Card animation frame = Function.Param(0)

    --- set return to 1

    System compare: Function.Call("hasCard",3) & Function.Call("hasCard",5) & Function.Call("hasCard",7) =1

    --- Do something

  • It works perfectly, thank you so much!

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