AllanR's Recent Forum Activity

  • Ashley says asm.js is much faster than the old Box2d web. But there are known bugs in the asm.js that cause crashes like that. Chipmunk Physics is a really good alturnative (plugin by Rojohound). It is the fastest as far as I can tell, however asm.js is more accurate in terms of simulating real physics.

    I think it is sluggish on mobiles because they have much weaker GPUs and can't handle the constant flood fill that creates the water - plus in my version the subroutine that calculates the splashes and smooths out the waves is pretty cpu intensive as well. But I know it should be possible to do on mobile because Jetpack Joyride does it just fine - they must have found some way to optimize the process! : )

  • donutpond

    I remember having a lot of fun with the capx shinkan made way back then. I tried to make the waves look a little rounder, and I wanted to make splashes too, so I ended up adapting some formulas I found somewhere. It worked well on my desktop, but I was disappointed with the performance on my iPhone... I meant to post a link back on the original thread but never did.

    To have things float in the water, I have a row of invisible sprites with the solid behavior - they get updated to the water's surface (minus an offset to make things look partially submerged).

    Press space bar to make waves, or click the mouse to make a splash. The beach ball has the platform behavior so you can move it around with the arrow keys. (Flushing drains the water, then it fills up again)

    try it out here: http://www.rieperts.com/games/Water

    you can get the capx here: http://www.rieperts.com/games/forum/water.capx

  • tgeorgemihai

    well, I found a way to do it - don't know if it is the best way or not. The layer with the cards on it needs to have "Force Own Texture" set to yes. Then you need solid rectangles for the top and bottom areas you want to block out. Then on top of those rectangles you need another rectangle with the effect "Source Out".

    see my example: http://www.rieperts.com/games/forum/mask_test.capx

    The piggies have Drag and Drop behavior so you can move them around to see how the masking looks...

    Note: if your game is spawning new cards on that layer, you will always have to move the rectangles with the source out effect to the top of the layer after creating each card - otherwise the cards will be in front of the mask.

  • 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.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 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.

AllanR's avatar

AllanR

Member since 21 Nov, 2013

Twitter
AllanR has 23 followers

Trophy Case

  • 10-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

19/44
How to earn trophies