NicotineLL's Forum Posts

  • I'm a huge dum-dum... there're regular expression functions - RegexMatchAt(), RegexMatchCount(), etc.

    oosyrag tokenat() uses separator to create keys, I need to get the value in between given characters (what regular expressions do)

    R0J0hound I checked it out, but I'm not quite sure how to work with XML files and this plugin in particular. I think the functions I mentioned above would work in this case.

    Thanks for the suggestions!

  • With the help of R0J0hound I made a script that reads SVG polygon coordinates and creates a terrain.

    Currently it reads it from a .txt file (using tokenat() and creating loop for each shape) which has to be manually populated with information. I was wondering if this step can be eliminated and improve the workflow. However to read directly from the SVG file it needs to get the coordinates in between characters and create a loop.

    For example this is an SVG code

    <polygon class="st0" points="1520.4,280.6 1456.7,280.6 1456.7,339.7 1527.7,339.7 1527.7,357.4 1435.5,357.4 1435.5,193.5 
    	1524.1,193.5 1524.1,211.3 1456.7,211.3 1456.7,263.1 1520.4,263.1 1520.4,280.6 1520.4,280.6 1520.4,280.6 "/>
    <polygon class="st0" points="1550.3,345 1550.6,341.9 1551.4,339 1552.7,336.4 1554.4,334.2 1556.5,332.4 1558.9,331.1 
    	1561.7,330.2 1564.7,329.9 1567.8,330.2 1570.6,331.1 1573,332.4 1575.1,334.2 1576.8,336.4 1578,339 1578.7,341.9 1579,345 
    	1578.7,348.1 1578,351 1576.8,353.5 1575.1,355.8 1573,357.6 1570.6,358.9 1567.8,359.8 1564.7,360.1 1561.6,359.8 1558.8,358.9 
    	1556.4,357.6 1554.3,355.8 1552.6,353.5 1551.3,351 1550.6,348.1 1550.3,345 1550.3,345 1550.3,345 "/>
    <polygon class="st0" points="1556.4,310.2 1553,193.5 1576.3,193.5 1572.9,310.2 1556.4,310.2 1556.4,310.2 1556.4,310.2 "/>[/code:572xu8az]
    
    So it needs to - for each <polygon> get coordinates between points=" and ", and create for each loop.
    
    My question is how to get the value between points=" and "? Is there a system function that can do that (something like PHP's preg_match() maybe)?
  • At this point I really don't want to implement level editor (which might solve the issue once and for all) and complicate the situation more than it already is.

    I might have to rethink my gameplay and tune it to the limitations of C2. It's really sad to think that we cannot create good physics based games with the provided tools, whether it's C2 or Box2D's fault, or even my own for the lack of knowledge.

    Thank you again for the great example you made earlier, I really do believe it's the best that can be done with the tools provided.

  • I finally got around to do this again since my last try a few weeks back.

    Your example was quite helpful and I did manage to make it work with SVG polygon, but it's a bit buggy. First dot goes to x0y0, SVG coordinates are flipped vertically, and ball has no friction, but with a bit of tweaking it might be fixed.

    Anyway, I was thinking about what you said earlier about the Canvas plugin. Is there a way to feed raw data into it? I found an extension for Adobe Illustrator called Drawscript that can output quite a lot. E.g.:

    fill(255,255,255);
    strokeWeight(1);
    stroke(0,0,0);
    bezier(661,508,663,506,671,508,671,508);
    line(671,508,671,518);
    line(671,518,661,518);
    bezier(661,518,661,518,660,511,661,508);
    [/code:1gdyzmfv]
    
    I guess making some sort of parser with events could read this code, but just wondering if there's something build into the plugin.
    
    I'm also not sure, is it possible to add physics to the Canvas or should another physics object be made that follows the Canvas path and draws the terrain?
    
    P.S. we need a feature like [youtube video="vlL-u9NxfOA"] integrated into C2, it'd make our lives so much easier...
  • How to use AdMob and IAP official plugins on Android-Crosswalk/XDK

    Though, the first step should probably be buying a Construct 2 Personal License

  • The debugger gives an estimate, it is close, but not necessarily the correct amount of resources your game uses. Most often than not, the problem is CPU usage.

    The best way to test is export your game with Node (as NW.js if available on free version), run the game and monitor the CPU and RAM usage via Task Manager (on Windows). If you're developing for mobile you should test on that as well. Pretty much export and test on the actual device you're developing for.

    In general most modern tech have at least 1GHz CPU (I doubt C2 games utilize multiple cores) and 4GB of memory you might want to aim quite lower than that to make sure it runs great on any device.

  • The simplest of all is changing "Every tick" to "Every X seconds" (0.05, 0.1, 0.15, etc), that will add a delay to the AI movement. Moreover you can set the seconds to random() that will add a bit of realism. Do a bit of testing and eventually you'll get it right.

    Every 0.05 seconds -> Ball.Y < Paddle.Y -> Paddle simulate pressing UP (reverse for DOWN).

  • Here are a couple of tutorials:

    1. Supporting multiple screen sizes - https://www.scirra.com/tutorials/73/sup ... reen-sizes

    2. Export and build your games with Intel XDK for Android & IOS - https://www.scirra.com/tutorials/1353/h ... lkphonegap

  • Have you tested it though? I tried replicating a heavy load, but it still changed smoothly.

    If executed right the overlay opacity would happen before we even call the second layout (from 0% to 100%) and after we loaded the second layout (from 100% to 0%). That would mean that the freeze would happen in between, when the overlay is at 100% opacity.

  • If the layer with the content has any parallax it will go to the left.

    As for the testing bit - the easiest way is simply resizing your browser window.

    Other than that, you can use Chrome's emulator (Open your game then press CTRL+SHIFT+I and then CTRL+SHIFT+M):

    or Intel XDK's emulator:

  • Aren't "Fullscreen in browser" options "Scale outer" or "Scale inner" going to work here? Using Inner it always crops to the center, and Outer can be centered by setting the layer's parallax to 0,0.

  • What about something like a fade to black (color) effect:

    Example: .capx

  • Changing the browser in Preferences will take effect the next time you create a new project. It will not change your current project's settings. Like Lancifer said change the browser in Project Properties (click on an empty space in your layout, on the right search for Project Properties and click on View, then search for Preview Browser option and select one from the dropdown menu).

  • When you click on a layer and look at the settings, make sure the Transparent option is set to Yes. Otherwise the layer will have a background and bottom layers will be invisible.

    If that doesn't work, check the if the Visible in Editor option is Yes for all layers. Also Blend Mode - Normal. And if that fails try reinstalling C2.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • It's been really fun playing around with the Scirra Arcade and Google Play options and the positive feedback motivated me to polish the game further.

    Update v1.1.3

    • improved collision detection
    • improved loading time
    • improved graphics
    • added support for all screen sizes in the wide screen area (16:9)
    • added Scirra Arcade rankings
    • added a few visual effects
    • added score sharing for Twitter and sharing for Facebook
    • added in-game instructions
    • added visual and sound effects for new high score
    • other minor tweaks