ThomasOlsson's Recent Forum Activity

  • Hi Sebastian!

    You have many ways to this I guess. Here is what I would do with my little knowledge ^_^ :

    -You could set the Square's solid disabled as soon as the player is overlapping it, and enable it back if the player is not, but it would also allow the enemies to pass as long as the player is passing on it, so it might be stupid.

    -You could "bump" out enemies on collision with the square if it is not solid by using the "Set Vector" platform action or even more dirty by reseting there position to self.X-20 if they are on the left (20 is an example here) and self.X+20 if they are on the right side of the object.

    If you send me your CAPX project I can try to build something and send it back.

    Vega

  • Sorry I didn't understand the thing well. Could you upload a Capx then I can figure out by myself what you want to do ?

    Vega

  • I don't know how you exactly want to use this system here but I actually found that the spreading of the rooms is kind of beautiful ahah. Also, if you really want to hide it why don't you do something like hiding the screen as long as the rooms keep moving, and "unhide" it as soon as everything stopped ?

  • You're welcome, nice to help

  • Hey man, I managed to do the "tedious" way, with a group and local variables. It works really well even if it was kind of a mess at first. Also I used the "pick nearest instance" to determine who the IA fighter focuses.

    Thanks, your last sentences gave me that idea.

  • Hi mestrejedi3221.

    First I would include the platform behavior to enemies (or 8 directions if it is no platformer), it will be much easier to control their movements this way (don't forget to put "Default controls" off).

    Also use an instance variable in enemies to memorize the player even if he left the LOS, being able to run after him then. Let's call it "Memory" (initial value = 0)

    About shooting I would do something like :

    ("-" represents sub event)

    if Enemy has LOS to player : Set memory = 1

    • Enemy compare X : if greater than Player. X : Set mirrored
    • Enemy compare X : if lessthan Player. X : Set not mirrored
    • Every 3 seconds : Spawn bullet

    About moving to the hero :

    if Enemy has NOT LOS to player :

    and Enemy memory = 1

    -Enemy compare X : if greater than Player. X : Simulate control Left

    • Enemy compare X : if less than Player. X : Simulate control Right

    Does it help ?

    Vega

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi DurandalCorp

    First of all be careful your link is tricky because there are spaces in it, here is the right one :

    https://dl.dropboxusercontent.com/u/103 ... index.html

    It is a very interesting matter here. Did you try to use the "Set time scale" system action ?

    Vega

  • Hi guys ,

    I'm working on a fighting game and there is something I can't do here. Lets start by explaining you what I would like to do.

    So there are two fighters in my layout. The important thing is that they are the same object, there is only one type of character here. Fighters have several instance variables, including "Control" to define who controls them (0=Player 1, -1=Computer AI) and "Team" to define who they can attack or not, as I plan to put teamfights.

    I divided my code in two main parts, the first is the actions of a Fighter (run, punch, jump, etc...) and the second one is what calls those actions : keyboard inputs if it is a player, and AI guidance if it is a computer playing.

    I am stuck in this AI thing and it might be because I'm confused with picking. Lets simply start with trying to make a fighter run against another. It looks like this :

    if Fighter | Control = -1 (#If the fighter is played by computer)

    -Compare X : if Fighter X greater

    than Fighter X : Simulate control "Left"

    -Compare X : if Fighter X less

    than Fighter X : Simulate control "Right"

    I need the AI to choose a fighter that is in a different Team and is the nearest target available. Since all the Fighters are the same object, it goes much more complicated and I'm lost here. Any ideas of how to proceed ?

    I hope my explanation is clear enough. I been watching tons of videos and stuff but I can't make it clear.

    Thank you guys

    Vega

  • I found something pretty ok with booleans and using animation's end as conditions like you suggested it.

    Thank you very much guys !

    So cool to get helped.

  • I'll give it a try guyz, thank you so much.

  • Is that it ?

    I'm sorry man, still the same... It's confusing.

    I think it might be because of my dirty way to set "EnemyHurted" to false. As you can see, after

    being hit there is a delay of 1 sec and I set it to false again. It might be because of that isn't it ?

  • Hey Lennaert,

    It looks a bit better but still it is not clear. The enemy is able to attack me even if I

    keep punching him, like the attack event is finding a short delay to do it.

    Here is a screenshot of the event sheet piece :

    http://img11.hostingpics.net/thumbs/mini_480833Screen.png[/img][/img]

ThomasOlsson's avatar

ThomasOlsson

Member since 10 Jul, 2014

None one is following ThomasOlsson yet!

Trophy Case

  • 10-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies