How do I - Handle overlapping objects with passing time

Just started using Construct 2? Post your questions here

Post » Fri Sep 09, 2016 6:50 am

99Instances2Go wrote: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
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Fri Sep 09, 2016 12:50 pm

I have still no idea what you are actual making. And therefor (without context) i mostly have no idea what you talk about.
B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Fri Sep 09, 2016 9:27 pm

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
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Thu Sep 22, 2016 7:05 pm

@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
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Post » Thu Sep 22, 2016 7:47 pm

B
33
S
18
G
28
Posts: 2,493
Reputation: 20,950

Post » Thu Sep 22, 2016 9:19 pm

Message: timcs can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
99Instances2Go wrote:You mean this ?

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


Brilliant , thank you again 99instances20go .


TimCS
Regards

TimCS
B
23
S
8
Posts: 132
Reputation: 1,921

Previous

Return to Beginner's Questions

Who is online

Users browsing this forum: No registered users and 1 guest