AllanR's Recent Forum Activity

  • you could give the doors an instance variable "DoorName" and give each door a unique name, then give the switches an instance variable to hold the name of the door that each one opens.

    when the player clicks a switch, have a condition that picks the door with the name contained in the switch's variable...

  • yes, you can create a long text object, and give it bullet behavior, set the speed to about 50, make "Set Angle" NO, "initial State" disabled.

    put the text object just below your layout, and when it is time to roll, set the angle of motion to -90, and enable bullet behaviour.

    if you have a lot of credits, it may be easier to make a text project file, and load that into the text object.

  • worked for me... you have some other event that is cancelling it

  • jobel's way would also work - there are always lots of ways to do things.

    another option would be to save the Human layer X and Y coordinates from the original touch. You create the button_point at Touch.X("UI") and Touch.Y("UI"). You could have added instance variables and stored the Touch.X("Human") and Touch.Y("Human") to know where to create the new object later. Or you could have created the button_point on the Human layer, which would then scroll with the layer so the point doesn't end up somewhere unintended...

    but if it is working the way you want then great! :)

    the nice thing about layerTocanvas / canvasTolayer is that it will work from any layer to another, regardless of parallax or rotation.

  • To get from a point on one layer to the correct point on a different layer, you can use LayerToCanvasX / Y and then CanvasToLayerX / Y

    so, since you have the object Button_Point on the UI layer, and want to create a Swat object on the Human layer you would do this:

    System Create Object Swat on layer "Human" at CanvasToLayerX("Human",LayerToCanvasX("UI",Button_Point.X,0),0) , CanvasToLayerY("Human",0,LayerToCanvasY("UI",0,Button_Point.Y))

    that is a little confusing to see all at once, so I will break it down...

    You have Button_Point.X which is on the UI layer and want to know what X is under that on the Human layer, so you first convert to a canvas coordinate by:

    LayerToCanvasX("UI",Button_Point.X,0)

    lets call that cx, then you take cx and convert it to a point on the Human layer by:

    CanvasToLayerX("Human",cx,0)

    (and you have to do the same for the y coordinate)

    What happens if you scroll after you create the button_point - before you create the swat object? since the button_point is on the UI layer, it will not scroll with the map, and then it will be over a different place than where the player click...

  • there are lots of ways to do that... the easiest would be to make a list of questions and a list of the answers and out them in an array. A harder way would be to parse the question string, and calculate the answer. (You would have to use this method if you allowed the play to enter questions).

  • Fun game! tried a bunch of different strategies to see if I could survive the boss... can he beaten?

    my best score was 1066.

    you need a restart button!

  • Since the shooting code (event 19) comes after the Movement Code (event 4), as long as the L key is down, the animation will get changed right back to the SHOOT animation on every tick.

    one thing you can do is move the Set Animation action in event 19 to event 23. that way the shoot animation will only show when a shot is actually fired.

    however, if the player is also moving, then the very next tick the animation will get changed back to a movement animation. So it will be almost impossible to see.

    you will need some kind of system to stop changing the animation for a short period of time...

    you already have the firerate/can_shoot variables, so I would add a subevent under each movement event (and the idle event if you are setting the animation there as well), have the subevent check if can_shoot=0, then set the direction / animation / mirrored / speed.

    (so just leave the Simulate Platform pressing actions where they are, move the rest of the actions to be under the new subevents)

  • you typed that last message while I was typing and looking for the old thread...

    you are right in that "on path found" does not need a UID.

    But my understanding of pathfinding is that multiple objects can be looking for a path at the same time, so I don't think one can be holding up others.

    my gut feeling is that you still have a picking issue of some kind, or possibly a scheduling issue with your array (giving objects conflicting orders).

    One thing to check out is if multiple NPCs start things at the same time. That is a common place for picking issues. if several NPCs are picked, but the action only calls the function once, or with the wrong UID, that would cause trouble. Depending on your code, you may need a "For Each" loop to make sure each NPC gets processed...

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I helped someone debug a similar project a few months ago, and it was definitely their code - picking issues, not handling all the path finding triggers, setting things up incorrectly, etc.

    see thread: https://www.construct.net/en/forum/construct-3/how-do-i-8/why-objenemy-going-south-141207?kws=path

    it is amazing how minor little details can make a big difference in tracking down issues!

    There is nothing wrong with the approach you are taking - using a family is a great way to optimize your code. Like plinkie said, using functions and picking by UID is a great way to help keep things organized. Just make sure you aren't breaking the object picking before you call the function.

    if none of this helps, then maybe try to save your project with a new name and then delete as much as you can to make it smaller so you can share it...

  • dazedangels

    if I understand what you are trying to do, there is more too it. since the User Media object is not actually moving on the canvas, you will need another way to tell if the user is moving their phone. To do that, use the Touch object - the Alpha/Beta/Gamma values tell the device's orientation...

    from the manual:

    "Alpha is the compass direction in degrees. Beta is the device front-to-back tilt in degrees (i.e. tilting forwards away from you if holding in front of you). A positive value indicates front tilt and a negative value indicates back tilt. Gamma is the device left-to-right tilt in degrees (i.e. twisting if holding in front of you). A positive value indicates right tilt and a negative value indicates left tilt."

    So, you will have to use those values to calculate how to position the balloons on the screen, (or if they are on the screen)...

    And, if you want the user to be able to "walk through" the environment (REAL AR), then you would also have to use the Geolocation object to be able to track their position. That would also require the user's permission and will help drain their battery faster... and I don't know if that would work indoors.

  • a CMS is a Content Management System. it allows you to manage content for your game - in this case, add questions, maybe manage user accounts and high score lists, etc.

    for this to work, you need to have your own web site to upload the files that came with the template.

    many web hosting providers have file managers that can be used to upload files - otherwise you will need to set up an FTP account and use a separate ftp program...

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 11-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
  • Popular Game One of your games has over 1,000 players
  • x2
    Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • Steady Visitor Visited Construct.net 30 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies