Firespike33's Forum Posts

  • 3 posts
  • I have a bit of a problem. I'm making a turn-based RPG where the player and enemy repeatedly attack each other. Whenever I update the code for attacking, I have to copy-paste it from the player to the enemy, replacing "player" with "enemy" and vice-versa. This becomes tedious, so I decided to create global variables called "attacker" and "attacked," which would be set depending on who's attacking who. In the code, I could refer to them instead of having two chunks of..."code."

    The problem is that Construct 2 won't let me enter variable names as objects. Can this be done, do I have to keep copy-pasting, or is there another way to solve this problem?

    Random, unrelated question that I DEFINITELY bothered to research EXTENSIVELY before asking: Is there a way to enter Java code or something similar instead of selecting actions? I can code much more quickly than I can click on things.

  • Turns out I left some code in that deleted the enemy's health bar.

    I feel so stupid.

    Anyway, mods can lock this.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I have an RPG where the player fights enemies (duh). When the enemy is defeated, the player gets its gold and XP, and then the enemy is deleted. Immediately after, a new enemy is created. The new enemy has (I believe) exactly 0 health, even if I change its health variable after creating it, but it should start out with 20. I have the free version of Construct 2, if that makes a difference.

    Off-topic: where are the rules? I couldn't find them.

  • 3 posts