cvp's Recent Forum Activity

  • I am a bit confused.... have you looked at the example I posted? you will get the interval between the two clicks in milliseconds.

    then just convert the milliseconds to whatever you want: days, hours, minutes, seconds etc.

    I do not see a reason why you would do all the events...

  • Problem Description

    Turret behavior "acquire target" does not works as expected. It seems like it tries to target the first(lowest UID as far as I can tell) instance of that object and if that is not in range it does not try to target other instances of that object.

    Attach a Capx

    setup 1

    https://dl.dropboxusercontent.com/u/2560922/mobiledev/forum/turretBehaviorNotWorkingAsExpected.capx

    (the next one here is just to make sure the second scenario mentioned below is understood)

    https://dl.dropboxusercontent.com/u/2560922/mobiledev/forum/turretBehaviorNotWorkingAsExpected2.capx

    Description of Capx

    The capx contains a "shooter" sprite object with bullet and turret behavior and 2 types of targets.

    Steps to Reproduce Bug

    You have to run the capx in 2 variations to see the issue i am talking about.

    • Run the .capx
    • the "shooter" will move in range of the target with the number "2" on it and shoot
    • After 3 seconds he will switch target to the target with the number "1" on it. (it will be the one closest to the bottom)
    • That is what I would expect (as shown below it shoots at target "1"
    • Now move the bottom "1" to a location further to the right (outside the range of the shooter turret) as shown in this screenshot:

    Observed Result

    The "shooter" will after the 3 seconds still keep on shooting at the target "2"

    For me it looks like the "shooter" only looks at the first instance of target "1" and decides it is out of range and goes back to target "2" (as would be expected when the target is out of range)

    Expected Result

    I would expect the "shooter" to switch target to the second target "1" as it is clearly in range of the "shooter" turrets range.

    Affected Browsers

    • Chrome: YES
    • FireFox: YES
    • Internet Explorer: YES

    Operating System and Service Pack

    Windows 7 Home Premium SP 1

    Construct 2 Version ID

    163

  • Try this: https://dl.dropboxusercontent.com/u/2560922/mobiledev/forum/saveTimestamp.capx

    It gets the unix timestamp (time since Jan 01 1970) in milliseconds and stores it in webstorage.

    Second click (and the once after) will update the difference in time since the first click.

    Hope that clears it up a bit for you.

    And p.s. you cannot bother me. I know how it is to be stuck on something. I just hope I can supply some help.

  • I actually first started using it for the games I made for Tizen. (it is not in my current android published games)

    On Tizen it is enough to close the game, I have not tried it on other platforms.

  • you can use the "browser" object. it has an "on back button" condition.

    On the browser object there is also a "close" action which should close the game.

    (havent tried this on Nokia though. But it works on other platforms)

  • I am currently not home. But you can have a look at the .capx linked in this topic.

    https://www.scirra.com/forum/viewtopic.php?f=147&t=88746&p=702329&hilit=calendar#p702329

    I know it uses the date plugin.

    Let me know if that does not help you, then I can throw something together sometime this evening.

  • Yes that is what I am suggesting. You can use webstorage to persist the value between game sessions.

  • You can add the "browser" object to your project.

    the browser object has an event called "On back button" which will work on mobile devices with a back button.

  • You have to supply the icon when you compile your app in the cloud compiler (Cocoonjs) that icon will show on the main screen

  • if you want it to keep counting while you are out of the app you need to consider the system day and time instead.

    Save it when he clicks and then compare it to what it is when the users clicks again.

    Rexrainbow made a nice plugin for date and time you can use.

    https://www.scirra.com/forum/viewtopic.php?t=63492&start=0

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Have a look at how containers work.

    Think that can do the trick for you.

    When you create one object the other objects in same container are created and if 1 is destroyed so are all the members of the container.

    https://www.scirra.com/manual/150/containers

  • Yann Sorry for the lack of clarity in my explanation. I was trying to keep it simple, but it probably got to simple.

    Enemy2 is actually a wall.

    if you run the capx you can see that the shooter will move forward until it find its first target which will be enemy1.

    The thing is that i only want the shooter to stop and shoot enemy1(the red ball) if the wall(enemy2) is up. If the wall is gone/destroyed then the shooter should continue through the gap between the 2 enemy1's.

    Hope that made it a bit more clear. otherwise let me know

cvp's avatar

cvp

Member since 23 Sep, 2012

None one is following cvp yet!

Connect with cvp

Trophy Case

  • 12-Year Club
  • Coach One of your tutorials has over 1,000 readers
  • Email Verified

Progress

14/44
How to earn trophies