tarek2's Recent Forum Activity

  • rbailey83

    Your Welcome mate I'm glad it was helpful

    And about the Last question about the Enemy fight:

    I think everyone has different ways of doing things so you will find that to do one particular thing you will able to do it in many different ways and you just choose the one that you feel comfortable with and that you find it easier to understand just in case you need to come back to it to update and make changes the only exception to this is the end result "Performance" so however, you choose to do it always look which one is the best performance that's one rule that you cant break I guess

    For what I see on the pictures:

    -One thing that I quickly see is that on the Event (20) >>>you don't reference to which tile is because you have only the Enemy_Ork in the picklist and you didn't pick the tile there so it will not work as intended, if you wanna do it that way you need to pick the right tile with the ork then that action knows to which tile needs to apply the action

    -On event 21 the same you don't pick the tile beforehand so all the action that you apply there you apply them to all the tiles in the game as is an unreferenced object

    -Event 20 and 21 have the same "Condition" >>>EnemyOrk.Health is = to 0 or less to something, you could just move the actions from event 21 to event 20 is the same thing you don't need extra checking the same thing

    ======================================================

    Now this is how would have done it, will be easier if we simplify

    We have all the code running from if only you click the tile and the tile is "not Active"

    so the easiest thing will be to make the logic to the inverse for the "Enemy Fight"

    Example:

    On clicked Tile

    Is (not active)

    we have done all the code for that

    Else (The Tile Is Active)

    And is the Enemy = Then Action: Call for the Enemy Fight

    Capx: https://www.dropbox.com/s/2v0ypg746c6n3pf/Tiles%20Spawn%20Objects4.capx?dl=0

    For what I understand if you Fight the Enemy and you destroy it the tile of the Enemy has to be inactive again to be able to interact with it again and I guess all the neighbor's tiles that the enemy looked before has to become inactive swell to be able to interact with them well if I'm not mistaking

  • nevermind, i created a new project and looked from that and the function is showing, just wasn't showing for me when i tried looking for it in the example project you sent me

    Haa it may be that you had it already added to your project because once you added to your project you will not find it anymore on ad new objects because is already there and ready to use:

    This is the how is working on this new capx:

    Everything starts if you touch a tile

    On touched Tile:

    And the tile is not active meaning is untouched yet >> then choose random animation

    Then if the chosen animation is equal to "Enemy" then we call for the overlap check on the neighborhood

    Else: if is not the "Enemy animation" then we don't check overlaps just set the tile to active meaning that has been touched already you cant touch it anymore, and set the "Animated" to true this is to avoid any more animation change on this tile as will happen the scenario that will check for overlaps in different tiles and their neighbours and this one will be chosen again so by checking the "Animated to true" will be skipped

    If the Enemy has been chosen:

    Then The Function "CheckOberlaps" will check and do:

    -First, we filter to do the check to the none "Active Tiles"

    -One more filter don't check for the enemy tile which is = to Function.Param(0)

    -Then we proceed with the condition to check for the overlap

    Action: All the tiles overlapping and that meet the above Conditions >>set them to Active true

    Nex event on the Function:

    Pick the Enemy tile who called the Function = Function.Param(0)

    Action: set him to (Active & to Animated) true to avoid any further checking or animation change on him

    Last event on the Function:

    Now we pick all the ones that where Overlapping and the ones that haven't been animated yet = meaning still untouched

    Action: Then change animation & random choose Frames

    Action: set them all of them to animated = you cant touch them anymore

  • datiel12

    Your welcome mate, take care

  • tarek2 yep that's exactly what i was trying to do thank you so much, So it's the detector that gets called in at enemy spawn, and whatever tiles the detector is overlapping it locks out is that right? How do you do the functions? I haven't seen that ability or is that from a plugin?

    rbailey83 No problem man glad it was helphul

    Yeah that's right the Detector is the one checking for the neighbor's tiles of the enemy tile when is spawned but only checks overlap if the enemy was spawned also if you notice I exclude the enemy Tile on the overlap Checking , I used the function because is a Trigger so it checks the overlap once and also the Function are really good because you can pass the UID of the objects so you can do more extra staff to that particular object later on by just picking that UID

    You should definitely learn how to use the Functions if you can as has many benefits, they are very easy to learn and once you learned you will see is not much complicated and very useful

    The Function is an official plugin from c2, you can add the Function Plugin by going to the Right side panel and right click on the folder that says "Object Types" then choose insert new objects and then choose "Function"

    You can read more about it here

    https://www.scirra.com/manual/149/function

    I must be really tired when I did this yesterday as after wake up today and look it at it again a saw a few errors like the "trigger once" in one of the function so we don't need that in a function as the Function is already a trigger once so yeah haha I don't wanna show you bad habits I corrected that and another thing that we don't need is to create and destroy the detector that was unnecessary from my part so I update the Capx much cleaner

    https://www.dropbox.com/s/1lwpxn8k4pdgaie/Tiles%20Spawn%20Objects3.capx?dl=0

  • Hi rbailey83

    something like this??

    You didn't specify which types of tiles (Tilemaps, sprites tiles, etc..) so I just did it with Sprite Tiles, I hope it helps

    https://www.dropbox.com/s/al7t5tl7cvx1yv9/Tiles%20Spawn%20Objects.capx?dl=0

  • tarek2 , Thank you very much! Is kind of that.

    What I need is to bring the popup In and Out without changing the value of the Slider Bar (slid_line).

    Like: If I bring the Popup In and set the value of the first bar to 60, when send the Popup Out of the screen, the value of the bar would remain 60.

    What is happening is that I set the bar value to 60, and when I send the Popup out of the screen, the bar value goes to 0.

    I see what you mean, maybe like this?

    https://www.dropbox.com/s/hhsaegcz6vwroy0/SlidePopup2.capx?dl=0

    And also you can do it in less events

    https://www.dropbox.com/s/t9i5b6z7rip1gml/SlidePopup3.capx?dl=0

    you set your minimum value at the start of the layout then it only changes if the value is changed

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi, I'm not sure if I understood properly is this what you need?

    https://www.dropbox.com/s/3f5vd0yz9rahvze/SlidePopup1.capx?dl=0

  • datiel12

    Also one quick note just in case you Forget:

    Right now you have one enemy and one gun and I'm not sure if you planning to add more instances of that enemy on the same level but if you do make sure you link each gun with his Parent enemy other ways you will have travel picking, you can do it by "Instance Variables" or you can link them in a "container"

    Good luck with your Game looks pretty good

  • datiel12

    I'm so glad that you just sent the minimum capx other ways I would have had my second heart Attack <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">

    if you change this in those two places will work:

    On Event sheet: EnemySheet Lines 27 to 29

    https://www.dropbox.com/s/v34ozsm4hev0kxy/turret%20gunFix.png?dl=0

    And On Event sheet: CorePlaySheet Lines 90 to 91

    https://www.dropbox.com/s/cj5kdlrczbba5 ... 2.png?dl=0

  • datiel12

    before you post your capx try this

    https://www.dropbox.com/s/orbftbkmjt3qp8f/turret%20gun.png?dl=0

    note: you need to put the enemy gun in a container with the enemy

    Edit: jeje you where quicker done me to post the capx I will have a look

  • datiel12

    can you share a minimum capx so we can have a look? is quite hard to know just from the pictures as it may be the fault in somewhere else

    Also, who is the one that doesn't shoot the Enemy or the Player?

  • Artpunk

    Nice one!! is Looking Grate can wait to play on the iPhone I like the nice funny characters haha I see like you don't lose the time well-done mate keep it up, nice to see people like you creating games with c2 gives a lot of motivation to create Games

tarek2's avatar

tarek2

Early Adopter

Member since 26 Jan, 2016

Twitter
tarek2 has 12 followers

Trophy Case

  • 8-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • x5
    Great Comment One of your comments gets 3 upvotes
  • Email Verified

Progress

15/44
How to earn trophies