Turn Based Attacks

0 favourites
  • 10 posts
From the Asset Store
A well commented RPG game template to learn from or use as a base for your own game!
  • Hey you,

    I am making an RPG game, where all the fighting is "instanced". Like Final Fantasy fighting. Under certain conditions I want the current player to jump out, attack and jump back to its starting position.

    I have got this part down pat. But, looking at all the other variables I am going to need to calculate and so on, the way I am doing it now just seems wrong.

    I am used to Functions in C++. I know there are Functions available in Construct 2. Do they run the same way as C++? Can I pass variables between them?

    Here is a screen of the code I am using right now. Should I continue using this format or switch to Functions? Got any tips/advice?

    <img src="http://img16.imageshack.us/img16/470/fhb.png" border="0" />

  • When calling a function, you can also pass parameters. These are simply numbers or strings that are made available to the function.

    For simple questions about what the different features do you should just look it up in the manual.

    It's also a bit difficult to imagine exactly what happens with that screenshot since we know nothing about the position of the objects or what they are there for. It's easier if you share your file, so we don't have to spend ages interpreting your event sheet and just guessing what it looks like in your layout.

    If you don't want to share your file for some reason, you can recreate the bit you need help with in a smaller project.

    Anyway, I'd love to help, but I'm not really sure what the problem is, and what your events are meant to do, and I'd rather not spend the next 30min trying to figure it out when I could just press the preview button and see it in a few seconds. <img src="smileys/smiley2.gif" border="0" align="middle">

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Nimtrix Okay, I have posted it to my Dropbox. Hopefully this link works for you.

    Link Removed

    Simply put, I wanna know if I should start using functions for this part of my game? This turn based fighting is the most complex thing I have made, thus far.

  • Link works. What exactly do you intend to do with the functions, replace your current setup? Or what kind of variables do you need to, as you say, calculate?

    I'm sorry, I'm just having a hard time figuring out which parts you're happy with and what you want to change.

  • Nimtrix This is what I think needs to happen...

    Check which player can attack

    Check which spell/skill user selected

    Check which enemy the user selected

    Wait for attack button pressed

    On attack button pressed, jump to selected enemy

    Cast previously selected spell/skill

    Calculate damage

    Return player to starting position

    End players turn

    Calculate which player goes next

    (I was thinking of using a timer for each enemy/player)

    So someone with a lower attack-time could attack sooner then someone else with a higher attack-time.

    So, you wouldn't see its switch up like, Enemy/Player/Enemy/Player

    Instead you would see something like, Enemy/Enemy/Player/Player/Player/Enemy/Player

    Here's an example of what I am thinking of doing. Notice the wait time in the bottom right hand side of the screen for each character.


    Skip to 18:20

  • I give up for now. I don't understand functions or anything really, lol.

    Here is the latest build I was working on.


  • Well, almost the end of the day now. Can anyone else give me some advice on how to handle this?

    Even if you just have turn based attacks with the ability to select a target and use skills...

    Any example capx's I could dissect?

    Thank you,


  • I'm gonna try and put something together for you, but it could take a little while.

  • Alright, I'm sharing what I've got so far. There's a lot of stuff to add before everything is covered, but hopefully you can get some ideas from this. I planned on making the animations follow the green squares before I posted it, but I need a break right now, so here ya go:

    TurnBased_tekniko.capx (r134)

  • Wow, thank you for taking the time to put this together. I can see how what I was doing wrong with my functions. I was calling Global variables instead of parameters.

    Again, thank you so much. I'm going to sit down in a bit and try to figure out what you did here.

    Thank You,


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