AllanR's Forum Posts

  • you could create an invisible sprite, and pin the objects to that.

    I thought that the x and y coordinates for the layer wouldn't change by rotating the layer (only in relation the absolute x, y) but I don't rotate layers so I am not sure - I know from zooming layers that you have to be careful when how you compare things on different layers (convert the coordinates from one layer to another's).

  • maybe your collision polygon is slightly off...

    or maybe try the old Box2d web physics engine instead of the newer asm.js (or give Chipmunk Physics a try)

  • well, this is a sample I made for someone over a year ago, but it uses external triggers... maybe it will give you some ideas. http://www.rieperts.com/games/forum/Wall-Tracing.capx

    how fast do the objects move? how close do they need to be to the surface? how square are the land forms? are the objects thin like a person walking, or wide like a car or tank? Rotate as they go around? How do the new land forms appear? slide out of existing ones? or fall down? just appear? Do the objects just stick to the surface or does gravity hold them down?

    It is definitely going to be tricky to do it without external triggers... and have it be failproof.

  • Congrats on all the downloads! That is impressive. : )

    And Thanks you sharing details too.

  • C-7's example is awesome - but it might be more advanced than what you need (and more cpu costly than you want). (or maybe it is just my very slow work computer, lol)

    You may be able to do it the way you started above, but just isolate the light and fog area of the current room on a separate layer. Then that wont affect fog outside the current room (on a different layer)...

    Nice thing about C2 is you can have LOTS of layers!

  • paulscottrobson

    I ran into this problem, and could not find a way to have it not register the tap on objects below the one on top.

    So, the only option is to manually not process the tap on the other objects. One way, is put the events that process taps on the tilemap in a group and then disable the group when you open the map - then as long as the map is visible, the tilemap under it will ignore taps. (obviously, you have to remember to re-activate the group when you close the map).

    If you don't want to totally disable the entire tilemap, then you could have some kind of global variable like TapProcessed. Then have the first sprite set that to true. Other objects would check that to see if they should ignore the tap or not. Reset it to false on Touch End.

    Another way that worked really well for me was to spawn an invisible sprite at the touch point, that follows the touch (by using TouchID). Then checking that sprite for collisions with objects. I had to do this to properly handle multiple touch points. Using this method, you can turn off collision checking for any objects you don't wanted the touch to apply to. It got a little complicated, but worked really well. I was thinking of cleaning up the code and making a tutorial for it some day.

  • Waltuo more ideas...

    1) add a second instance variable to the objects called Complete or Unlocked, and when the hit box number and object number match, set the Complete flag to True. Then you can add an event to see how many objects are unlocked, if that matches the number of objects, then execute the next events... (first have an event to pick objects with Complete True, then you can have a subevent check the Picked.Count to see if it matches the desired number.)

    2) you probably need a "For Each" enemy in the code that destroys them. It is probably only killing one, which leaves the second one there to kill you.

    3) add an instance variable to the doors that specifies the target door to jump to. I would put the UID (Unique ID) of the target door in that variable. Then you can pick the target door by UID, and set the player to that door's coordinates. (You may have to add a Pick All doors, before you can pick the target door).

    another way- which may be easier to set up in advance if you don't know the UID, is to add another instance variable called DoorNumber, then put the number to jump to in the TargetDoor variable, and pick accordingly... (so the first door would be DoorNumber 1, it's TargetDoor would be 2, etc...)

  • Sargas I am not sure what you mean by "invert option"

    but what I do is create a sprite called Camera and give it the ScrollTo ability.

    You can then manually move the Camera sprite in relation to how you drag the mouse (the way you do in your capx) or you can pin it to a player, or you can use lerp or other ways to program it to move by itself.

    Because the Camera is a sprite, you can scale the way you move it to get different speeds, or what ever other effect you want.

    You can take a look at a test project I have been playing with (Angry Birds type game)... I have the Camera (green square) visible so I can tell where it is and what it is doing.

    each level (there are only 2) starts by showing the structure you have to knock down, then pans to the slingshot. You can manually drag the camera around instead (and that cancels the automatic pan). Once you launch a bird, the camera follows the bird unit it stops moving - than pans back to the slingshot.

    There is a button on the screen to change the magnification, but usually (in other projects) I use the scroll wheel on the mouse to zoom in or out to where the mouse is pointed to.

    You can see it in action here: http://www.rieperts.com/games/birds/

    you can get the capx here: (code is very messy because it is experimental, and it requires the Chipmunk Physics plugin) http://www.rieperts.com/games/forum/angry_birds_chipmunk.capx

  • I have used C2 for non-game projects, and it can do lots of amazing things.

    Displaying a list of documents or icons would be no problem. Importing text is no problem. Actually displaying a PDF or Word document within your project would not be easy (and would require finding or making plug-ins). Launching the documents into another viewer would be possible, but then you would be outside of C2, and not be able to let your project know what the user read, where they stopped reading, or whatever other features you wanted your app to offer.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • use the Browser Object - Go to URL.

    To display a photo, load it into a sprite.

  • You could add an invisible solid object behind the bridge for the player to walk on...

  • The manual drawing part with the mouse is just a way to test out different paths of various shapes quickly and to test concepts. It would be possible to randomly generate a path once you decide on basic parameters of what you want, or save a path after you have drawn it and add that to your game... (the path is just a series of points - most of the paths I was trying were about a dozen or two points.)

    MadSpy is doing a great job on what you are specifically after, I have seen quite a few people asking about how to make an object follow a path, and wanted to play around with a more general solution to the problem. So I had a bunch of concepts rattling around in my head - like could the path adapt itself to avoid obstacles, apply physics to the object so that it accelerates downhill and slows down going uphill, etc... Its a fun exercise to experiment on! C2 never ceases to amaze me. : )

  • I tried a slightly different approach... you draw a line by holding down the left mouse button. When you stop drawing, an airplane is created on the line and follows it.

    as the line is drawn, it is divided into a series of "nodes" or segments. Each node knows where to find the next and previous node. (a value of -1 marks the beginning or end of the chain - the plane reverses direction when it hits an end.)

    The code is very messy. The plane follows the line exactly as it appears, and sets the plane's angle to the angle of each segment - so the motion is not very smooth. I would want to either automatically smooth the line after it has been drawn, or have the plane smoothly transition from the angle of one segment to the next, and probably would do both... I also briefly thought about having the capx export the node list in json format so that a path could be easily imported into another project for an object to follow.

    You can draw multiple lines. There is a speed variable if you want the planes to move faster. There is a lot of room for improvement! : )

    you can download the capx here: http://www.rieperts.com/games/forum/follow_line.capx

  • I would divide the line up into a series of points (the more points, the smoother the motion would appear). Each point would be a way-point, and you could determine the angle difference between each point to tell your sprite to rotate as it goes around the loop...

    Each point should have a sequence number, so you can tell what the next (or previous) point should be...

  • I downloaded your capx file from the thread above and it crashed for me after a couple hundred coins were created...

    then I removed the regular physics behaviors and changed them to Chipmunk physics. I am up to over 2500 coins, and it has been running for around half an hour with no trouble. (I also added a text box that displays how many coins there are).

    I first tried Chipmunk physics last week when I needed to know how much force was being applied to an object and the regular physics did not seem to have a way to do that. But I was amazed at how much faster my game ran on my iphone with Chipmunk physics. With the asm.js physics it would stutter and was barely playable, but with Chipmunk physics it ran smoothly (as well as giving me the extra info I needed). So, I would give that a try!