Best way to program pet likes?

0 favourites
  • 2 posts
From the Asset Store
Best car suspension with spring effect and very cool terrain generation.
  • I'm making a pet game when you can choose from 2-3 pets and each pet likes/don't like certain things. I was thinking maybe using variables assigned to each item, compare the value to a chart of pet's likes and conduct the action.

    For example:

    Give an apple to a bat pet, the apple's ID is 3. Under the bat's like chart, the 3 variable falls under it's likes and eats the apple.

    As for the bird pet, give it an apple (ID 3), under it's likes chart, it's in dislikes and therefor doesn't eat the apple.

    That might be one way of doing it but I don't know how to make the likes chart. Is there a better way of doing this?

    I have the free version of C2.

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I've moved your topic to the Construct 2 forum as it is the version you are using.

    What you call "chart" is named an Array.

    You can find the manual article about arrays in C2, look for that terms in the tutorials and check out examples of use in the C2 How do I FAQ.

    Hopefully with all this documentation, you should manage to wrap your head around the concept and usage of arrays.

    The logic you describe is pretty close to how things would work using arrays.

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