How do I - Handle overlapping objects with passing time

0 favourites
From the Asset Store
Hand-painted tiles, objects, animated objects, and background to build a colorful Mayan civilization environment.
  • Yes, familys will help, for sure.

    But. Dont use differend objects. (for now) Use the same sprite with different animations (or frames). Learning that practice will give you joy in the long term, licensed or not. Instances are so much easyer to handle.

    If you use differend objects you will at some point (in the nearby future) have no other choice then to buy construct. Because 4 different objects means 4 times more code, and the free version has a limit in amount of code lines.

    Personal (just an opion) i think that you should buy Construct when you are ready for it, not when you hit its free limits while still learning it. Buying it should be a gift to yourself, one you are very happy with.

  • Yes, familys will help, for sure.

    But. Dont use differend objects. (for now) Use the same sprite with different animations (or frames). Learning that practice will give you joy in the long term, licensed or not. Instances are so much easyer to handle.

    If you use differend objects you will at some point (in the nearby future) have no other choice then to buy construct. Because 4 different objects means 4 times more code, and the free version has a limit in amount of code lines.

    Personal (just an opion) i think that you should buy Construct when you are ready for it, not when you hit its free limits while still learning it. Buying it should be a gift to yourself, one you are very happy with.

    Hi 99instances2Go

    Thanks for your input here, the goal with Construct is to see if it can do want I am after before I buy it , so yes so far it is looking as though I will. I have been "experiementing" with your last profect file trying to get my last niggle resolved but I must not yet have gotten to grips with Contruct because it is not working fully.

    So , once the enemy or in your example "BadBoy" overlaps the picked target using the UID, I need then to have e.g. 20 seconds to pass by, then the overlapped target starts to change appearance. So I tried to do this using opacity to stat with,. It looked like it was working but only a few of the overlapped targets started to change, some completely disappeared as I expected, others no change at all, and some went partially .

    I was using a for each Target logic where the "badboy" overlapped the target using the UID as a condition and only on every 20 seconds.

    Any thougthts on this please ?

    ** EDIT ** 28/08/2016

    I have it working to a point whereby when the enemy or badboy overlaps the target , this is going to occur at different times for each instance, so I have simply started with an every X seconds event - That then has a sub event of a for each target and then from there has two conditions, which are is badboy overlapping target and badboy.UID = target.UID . This then has the effect on each badboy overlapping each target to fade at different times because each overlapping happens at different times .

    Ideally I would like to store at what time the enemy overlapped the target and count the fading or appearance change from there but not sure how I would achieve this.

    Thanks

    TmCS

  • Just want to update this thread with the fact that how without the help of all who have responded to this thread and a thank you to 99Instances2Go for the work put into the example capxs files as well.

    I am hoping to look forward to using construct 2 and also hope that construct 3 will be released to support the Mac and Linux OS as well.

    Thanks

    TimCS

  • Sorry all I thought I had this nailed until now, I got my project to work in that the time for each enemy only starts with the timer once the enemy has reached the target, what I am struggling with now is when the timer reaches e.g. 30 seconds, I then want to trigger an action to change it appearance.

    So I thought I would try System-> every X seconds then using Round(enemy.timer.<tried CurrentTime , TotalTime and Duration here>("timetag")*100)/100=30

    But this has not worked. I presume I am going about this all wrong but there does not seem to be a timer compare to what its value is, there is an On Timer but I cannot see how that would help

    Thanks

    TimCS

  • System ... compare 2 values ... sprite.timer.CurrentTime("tag") ... > .. 30

  • System ... compare 2 values ... sprite.timer.CurrentTime("tag") ... > .. 30

    99Instances2Go

    Thanks again, still stuggling to get the target linked to the enemy by UID to only change that one target at the moment it appears to be changing not all targets but some.

    My logic (although clearly flawed is)

    System->enemy,timer.CurrentTime("overlaptimer") >5 (just to see it happen sooner for testing purposes) <then> ...

    .... for each enemy (I did try the logic first without the for each as well) <then> ......

    Is Food overlapping target .....

    is Food TARGET (variable for UID) = target.UID

    is target.Animationframe = 0 (default frame before any changes are made)

    If all above are true then change target,animationFrame = 1

    To try and cover all basis I even added the if enemy.overlapstarted boolen is true

    I then want to go on to state a similar logic but if the animination frame is already 1 change it to 2.

    Not sure why it is changing only some of the targets to a different frame though

    ** EDIT **

    I think I have sorted it but need to check a few things just in case, what I have done and it makes sense now, is put the for each enemy at the top of the logic and then check the time that has passed

    Thanks

    TimCS

  • I have still no idea what you are actual making. And therefor (without context) i mostly have no idea what you talk about.

  • Hi 99Instances2Go , the general idea of this game is to have emenies aim towards targets and if the enemies are on the targets for a period of time, the targets take damage, the idea is that the player character needs to remove the enemies before the damage occurs. Trying to keep the idea/game details really underwraps to avoid copycats etc (not saying you would do this BTW ) .

    ** EDIT **

    I hope I have not offended anyone with my above comment about copycats as it was not meant to. I have had bad experiences with trusting people I have known for sometime. So sorry if I have offended anyone.

    My next move from this is to create a collectable/bonus object (done some of this already) which when "picked up" will choose a random enemy and remove it. Got some of the logic right, but where I am failing is that I only what one collectable/bonus object to appear at once but at the moment I am getting 3 or more of these.

    Still this is going off subject so if I struggle with that I will post a new thread.

    Hope that gives a better idea of what I am trying to achieve

    Thanks

    TimCS

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 99Instances2Go with all of the help you have given regarding my post I am still working on this game and expanding its progress. With the Allreadypicked boolean set per target, this means only one enemy can only ever hit one target at one time, which to be honest was my originaly idea but then thinking through more , as each level gets harder, I would like the enemies to randomly target the targets even if there is an enemy already there.

    So onto my next question, when the enemies hit the target they always hit the target to what seems to be the origin point. So I have added further imagepoints to the target but the enemies still aim at the center ,the origin point. is there anyway to randomly target any of the origin points on the target object using moveTo or does this require another method ?

    Thanks

    TimCS

  • You mean this ?

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

    Brilliant , thank you again 99instances20go .

    TimCS

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