AllanR's Forum Posts

  • mec

    well, there were quite a few problems in there. It was actually saving the data, but it was never reading it and even if it did, the defaults were getting reset after every level. There was a lot happening every tick that didn't need to be running. I found the code very difficult to follow, so I structured it in a way that makes sense to me!

    It works well now... I put in comments to try to explain what I was doing. I didn't add any error checking (because there isn't much you can do) but it does adapt itself if the number or levels increases - you will need that because it did save on your system thinking there were 4 levels and now it thinks there are 12.

    http://www.rieperts.com/games/forum/localsavefix.capx

  • Sargas

    Well, my answer is still the same as the last time, although this time I made an example rather that just saying "use a camera sprite with Scroll-To behavior and scale the movement the way you want".

    http://www.rieperts.com/games/forum/Starcraft_map.capx

    I found a bug in C2 (and will file a bug report) - if you press and hold the middle mouse button, but release it out side your game window, C2 still thinks the mouse button is down. (EDIT: it only happens in FireFox, so it is not a C2 bug - it probably is a FireFox bug.)

    C2 can not prevent the mouse from leaving the game window (unless you go full screen). So, the drag camera function can not completely duplicate the way Starcraft does it... I remember reading a thread a few months ago about some proposal for future browser/HTML5 updates to allow that functionality but couldn't find it just now...

    as a bonus, I included a 9-patch selection box that I did recently to help someone distinguish between clicks and dragging to select units. I also made a clickable mini map, and added zoom on the main map.

  • Smileh

    Rayman uses a completely custom, in house engine - there are some awesome videos on youtube about how they make levels. They don't use tiles in the way C2 does. But they do build levels out of lots of small pieces, because every developer has to worry about memory use and GPU performance.

    I don't think you have to worry about using sprites for ground - as long as you use as few as possible, and make sure you don't have poor corners that will trip up your player. The only other option is to use custom movement, but that just creates a different set of problems.

  • Well, your player has to stand on something - unless you use custom movement and develop your own rules. You also have to build your scenery somehow. (And your game will be more memory efficient if you use small, reusable objects or tiles - that's what Rayman does.) But if you want to keep solid ground separate from the artwork, then use invisible solid sprites. one sprite can be stretched to provide "ground" across the entire layout. You can angle them to create slopes, add a couple more to make platforms... a few sprites can go a long way.

  • haven't tried it, but in HTML you would add the prefix ../

    so, from your Test folder you would ask for "../a.php"

    Edit: just looked at an old project where I used ajax to call php files, and I was just specifying the whole url. So I would expect that "http://www.bbb.com/a.php" would work. (The file I was calling was up twp levels, then down another directory.)

  • Rushty

    I looked at your example, added a jump-thru ramp and it does exactly what you want.

    The ramp shouldn't have the solid behavior and probably needs to be on an angle (possible reasons why it didn't initially work for you).

    http://www.rieperts.com/games/forum/jumpthru.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • agaman - Does sound like you have an infinite loop there...

    You don't really need the while loop. An Event sheet automatically loops already. At the start of layout, just show the first dialog. Then have an event for when the player clicks the next button to increment the global variable and display the next dialog.

    Kyatric just did a tutorial on making a dialog system last month: https://www.scirra.com/forum/viewtopic.php?f=147&t=150482&p=954835&hilit=dialog+tutorial#p954835

    so you might want to check that out.

  • SwatHound

    there is a Pick Highest/lowest option under Instance Variables for an object...

    so, Sprite > Pick highest/lowest > choose highest and HP

    Another way would be

    System > For Each (ordered) > Sprite > Sprite.HP Descending then stop the loop after the first one...

    but you would only do it that way if you were looking for a value that wasn't an instance variable, like the Sprite with the highest Opacity, or Angle or some other attribute.

  • Rushty

    Well, I started to suggest a couple complicated ways to do it, and decided I better test it out first. I started a new platform template project, and very quickly discovered that the Jump-Thru behavior does exactly what you want (and that my suggestions were terrible).

  • Waltuo

    I would create a family for stuff that can go on the scale (boxes and player) and add an instance variable called something like ExcludeFromScale (and possibly one called Weight if you wanted different size boxes or other items and need a specific weight to lower the platform). Anything overlapping the Prevent box would get flagged as ExcludeFromScale, and anything resting on top of an excluded object would then also get marked as excluded.

    So, to test objects overlapping the allow area (and not already excluded by overlapping the prevent area), I would do a For Each (oredered) scalefamily order by scalefamily.Y descending (that would start at the bottom and work to the top) and test to see if the object they are on is excluded.

  • It certainly can be done without physics. I would probably use a "detector" sprite - an invisible sprite above (and pinned) to the scale platform. When enough boxes and/or the player are colliding with it, then lower it.

  • To make things look like they are fading away, you usually make the mask with a gradient instead of a solid rectangle.

    I don't understand what you mean by only showing a small part of the layer... (There is almost always a way to do anything - usually comes down to how difficult it is and how it performs).

    These types of effects are generally well supported on mobile these days. The only requirement is that they need WebGL

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