Freddy33's Recent Forum Activity

  • System compare two values : family1.count is equal to 0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • System compare two values : family1.count is equal to 0

    Maybe i was doing the compare values wrong so I tried between values.

    Thanks plinkie :-)

  • System compare two values : family1.count is equal to 0

    Worked with

  • Family1.count = 0 and player is overlapping flag, go to layout 2

    Cheers Plinkie bro.

    Not working, was it because i used an instance variable?

    Thank you

  • Hello all.

    Just a simple one here. When all the zombies are dead and the player overlaps the flag, I want to go to the next layout.

    I think its something easy, but I am just not seeing it.

    Thanks for any help.

  • Thanks Corp,

    I just have one type of zombie. I am trying to keep this game basic and not over complicate anything. I think I am doing or trying to do too much. Trying to learn things by studying them. I am going to keep this game simple, utilize my skills and find simple solutions to simple problems and avoid doing anything to funky lol.

    I think I am taking the fun out of it by over complicating things or having to high expectations. Before I was trying to find different ways to do the same thing, I am just going to build and publish! - as long as its fun.

    I downloaded Unity, I am really keen to learn C# and there are good courses on Udemy. I promised myself I would finish a game on here though. I don't want to quit C3 because I really like it, but I think unity could open up job prospects and really help me learn a valuable skill. Any thoughts?

  • also what is distance> player.x and distance<player.x? is that the zombies X?

    I thought that ws needed to set the player distance?

    I am really struggling to with the animations, if I try to make th player stop with the width animation, it kindda messes up the other animations. I might have to go back to basics here and learn about switching animations.

    Thanks corp

  • condition

    compare two variables,

    distance(zombie.x,zombie.y,player.x,player.y) >= 70

    sub event 1 condition

    if zombie.x < player.x

    action1 zombie set not mirrored

    action2 zombie set x to self.x+5

    sub event 2 condition

    if zombie.x > player.x

    action 1 zombie set mirrored

    action 2 zombie set x to self.x-5

    that's it.

    if you want to limit where the zombie stops,

    you just compare the

    if zombie.x > player.x + zombie.width*2

    respectively

    if zombie.x < player.x - zombie.width*2

    the 2nd option would make the zombie stop at a distance from player of around zombie.width*2 or if your zombie width is 35 pixels then it will stop at 70 pixels distance from the player.x which is given by the player origin point so if your player has the origin point in middle then it will calculate from that, if your player origin point is to left or right you will face a bit of problems visually, cause logically its still 70pixels distance.

    Thank you Corp,Plinkie and Davy. Appreciate all the help. Worked perfect and the code looks a lot cleaner.

    I should be able to work out the rest.

    But what is this? self.x-5. The zombies self minus 5 pixels on the horizontal? Not sure why this works.

    Thanks again. :-)

  • Hello,

    Have you tried line of sight, you could then have the zombie turn to the player and attack.

    Yeah I took LOS away because I think it was causing problems.

    Is there an option for left and right?

    I am just going to try corpstudio events and see how that goes. Not sure why I am struggling so much.

  • Hi Bud,

    Thank you for explaining that. So it kinda of acts similar to a variable.I am dreading get into the math part of construct. But I am learning from you tube and you guys!

    Cheers corp!

  • Hi both, I am not sure. I have a variable of distance set up. And I think I have tired about 1000 variations of events with no joy.

    Basically the zombie starts left of the player. When the player gets within a certain range (600 pixels) The zombies moves from idle to walk. This is ok, its working well - Cap attached.

    But, If the player is to the right of the zombie, I am finding it nearly impossible to get the zombie to follow the player. Setting the player not mirrored wont work, because if the player turns hes going to mirrored non mirrored.

    I dont know?

  • One way is:

    Check the distance int(distance(player.x,playery,zombie.x,zombie.y)). if it's less than 70, then you can do:

    if the player.X is > than the zombie.X

    - simulate control right

    if the player X is < than the zombie.X

    - simulate control left

    Hi buddy, not sure why its not working, the events look ok?

Freddy33's avatar

Freddy33

Member since 7 Aug, 2018

None one is following Freddy33 yet!

Trophy Case

  • 6-Year Club
  • Forum Contributor Made 100 posts in the forums
  • RTFM Read the fabulous manual
  • Email Verified

Progress

9/44
How to earn trophies