reggie3's Forum Posts

  • 11 posts
  • It never occurred to me to look outside the bullet behavior for an action that would make this happen. Thanks for the help.

  • I'm using atan to set the angle for a bullet. Unfortunately, it isn't behaving the way I expect. I thought that by determining the difference in x values of the target and the origin (and doing the same with the y values) I could get the opposite and adjacent sides of a triangle. From that I should be able to use atan to get an angle that references north as the 0/360 degree point. I then thought I could just subtract 90 degrees from that angle to orient the angle to Construct 2's technique of using east as the 0/360 degree point.

    Well, this isn't working. My bullets seem to be going in the opposite direction they should be going. I've tried adding 180 and 270 degrees to see if that would have an affect, but it's not doing what I need it to do.

    Before going down this path, I thought there'd be some action that would just let me launch a bullet towards an x,y coordinate, but I didn't see one.

    Anybody know the solution?

  • clay.io seems to be a popular way of doing this. It is a plugin that enables you to put multiple back-end services for your game (including in-app purchases, leader boards, storage of save game data, etc.) There is tutorial on how to use it in the tutorials section of this site. There is also a large an ongoing thread about it in the forums. You'll be able to find both if you do a search for it.

  • You can spawn sprites using the "System" - "Create Object" action. You can do the creation in a loop if you need multiple instances of the same sprite.

  • No luck installing the Beta from Steam; it is requesting an access code.

    Also, no luck in uploading an attachment. However, I was able to put it on my Dropbox at The line of sight code that I'm trying to use is on line 93 of the "Level Play Event Sheet"

  • Thanks for the quick reply. Unfortunately, I'm unable to open your capx. Construct is saying that your file is from version 164.2 while I'm using 163. I purchased via Steam, so maybe that has something to do with it. I'm sure I'll get upgraded at some point.

    Maybe you can answer a question for me though. Is LOS layer dependent; will it work for objects that are on different layers?

    Also, here is a screenshot of the code I'm currently using:

    Do you see anything obviously wrong about it?

  • I'm trying to use the line of sight behavior to alert a sprite when it is within a certain distance of another sprite. Unfortunately I cannot get it to work.

    I am currently using "System-For Each" to cycle through every instance of an object. I am then checking to see if that object has line of sight to a family of other objects. If it does, both object are destroyed.

    The Obstacles setting for the object with the line of sight behavior is set to "Custom", but I haven't seen a difference between that and selecting "Solids".

    My project is at an impasse until I get this figured out, so any help would be greatly appreciated.

  • Do you know the radius of the circle?

  • I can think of a couple of ways to do what it sounds like you want to do.

    If it is an animation that is done in response to an event then (in your event sheet) you can call the "Set Animation" action of the sprite you want to animate when the event happens. From that action, you can specify which animation you want to run. You can create multiple animations for a sprite and name those animations using the "Animations" window that pops up when you double-click a sprite in the properties window.

    If it is a repeating event (like a character tapping their feet because they are waiting for the player to move them) then create a variable to enables you to track the status of the character ("running", "walking", "waiting", etc.) Set this variable when you need to, and then call "Set Animation" to play the animation that is desired based on the status tracking variable.

    I've never done a running game so I can't help with your other problem.

  • Lenneart,

    I'm trying to migrate to using your technique of placing all the graphics on a layout sheet that acts as a "pool" for me to create instances from as I need them. I'm having one problem though. I have a family of sprites that each have distinct names as a name instance variable. At any given moment, I need to spawn a particular sprite from that family. Usually, I'd just loop through that family in order to find the sprite that has the correct name. However, I am unable to do that using the technique you mentioned. I'm assuming it is because those sprites do not exist on this particular layout sheet yet. Have you figured out a way around this problem?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm using XML to set up some level data for a game. Part of the data includes a random number of child nodes under a node that is always included on each level. While the parent node is always there, not all children are present for each level. I'm trying to use xpath's "name" function to determine the element names for each of the children. The call is being made inside of a loop, and the syntax looks like this:

    XMLLevelData.StringValue("name(/LevelData/level/LevelWeapons/*[" & loopindex & "])")

    Unfortunately, this doesn't work. Before I go too far down the rabbit hole, does Construct 2 support full xpath functionality? Specifically, is the "name" function implemented?

  • 11 posts