megatronx's Forum Posts

  • megatronx

    In the first post there are already 2 example capx.

    https://dl.dropboxusercontent.com/u/235 ... ction.capx

    https://dl.dropboxusercontent.com/u/235 ... otype.capx

    Oh sorry, I've missed them! >.>

  • Hello,

    This looks really neat. Can we expect some sort of example capx ones the plugin will be released "clean"? Thanks

  • I wasn't logged out since yesterday so I guess things are working for me now too.

  • R0J0hound

    Thanks for this awesome plugin. I have a question thought. Is it possible to first paste layer to canvas, then chop that image in to even size tiles ( basically chop an image in to pieces) and load them one by one in to sprites?

    Also, if I copy to canvas, and canvas is on layout, it will show that image, right? I'm asking because I'm doing some tests with it and I'm bit confused on how it works.

    Thanks!

  • > Browser: On resized: Wait 0.1s, call function "position"

    >

    >

    >

    Excellent! I knew there was a quick fix. Thanks.

    Nevertheless, don't you think it should work without waiting?

    It should actually, because of the timing differences between canvas and browser resizing ( at least that's the behavior I observed when trying your capx ).

  • (Pixel perfect or instant-hit bullets)

    +Bullet.count > 0

    +For "" from 0 to 5

    -Move Bullet 60*dt in angle of Bullet

    +On loop ""

    +Bullet collides with solid

    -Destroy bullet

    Can I ask you why are you suing loop, and why 0 to 5?

    you pick you nose, take a sip of coffee

    If no tissue, do not sip your coffee

    One more idea would be to make Beginner and Advanced User modes in construct, and in Beginner mode focus on simplicity, with many intermediate level coding done as a plugin ( which advanced user could use too actually ) and limited diversity. I know it's rather not going to be implemented, but could work nevertheless.

    Ashley should have added easy tweaks that lots of users can do to minimize CPU usage, rather than highlighting what they are doing wrong, offer some pro-tips on how they can optimize their games.

    Here's mine:

    Work out if they need something to be done every tick (16ms) or not, if not, definitely put it under Every X seconds instead to lessen the calculations the CPU has to do.

    The most simple example is Enemy Health Bars. Often its updated in size every tick in most CAPX I've seen, not necessary since in most games, attacks or opportunities for enemies to take damage occur much less frequently than every 16ms. Multiply this by heaps of enemies onscreen, its just extra CPU cycles being wasted.

    Another simple tip, is to use Trigger Once often for events that you only want to occur once and not every tick. Like setting the Text in a textbox on touch or mouseover, tooltips for items etc. ie.A condition On Mouseover -> Set Text "AB" will occur every tick when its not required.

    Lots of other little tweaks can be done to get good performance of even complex games on mobiles.

    Call me a pessimist, but unless they will understand how to work in c2, they will be coming back with same issues, regardless of any tips and tutorials. For better or worst C2 is not as simple as it makes out to be. Maybe first tip should be "do not start with making a mobile game, instead try different little desktop prototypes"?

  • > megatronx I believe you misunderstood me. I want to change my layout size which is 1366, 768 to 683, 384 and I also want all the objects to scale as well with the same aspect ratio. I was just wondering if there was an easier way to do it than by manually scaling each image and re-positioning them.

    >

    Unfortunately the only real way is to do it manually. But, someone wrote a small script to do this automatically. It is in the forums somewhere. You are going to have to search as I didn't bookmark it.

    If HZGaming use letterbox scale, it will scale it down automatically.

  • What if I stick to a lot of layouts but keep saving the player's variables each time I leave and enter a room?

    Also, how does it work like I said up there in the Persist example?

    EDIT: I didn't mean to say that my game is for a mobile game, I'm just trying to find a general solution...

    Thing is, there is almost never one general solution . It all depends on how you want the game to behave. I never used persist object, but from what I did read, it is only to keep object's variables across layouts and not position. You could eventually create 2 instance variables ( or global variables ) PlayerX,PlayerY, and then on starting new layout, set it's position to new X but load Y from the variable ( if you moving horizontally ). Ah, and you'll need to store information which room your player is exiting, so you can determine which direction player is entering from to set his starting position accordingly. Best thing would be to use arrays, and create some layout naming convention that you could easily loop trough and compare with data in array.

  • You could check for distance and destroy the bullet several pixels before the wall. Another option would be to set it's position on collision to several pixels back. In both cases you got to make case of bullet direction/angle.

  • No, it's not possible this way. You got to do two separate sprites.

  • I didn't misunderstood you. Use letterbox scale or letterbox integer scale.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hm, I don't know, this doesn't seem that great, to keep removing and recreating everything... Specially for a mobile game.

    Well, you didn't say it is for a mobile game. Regardless, it's even more important on mobile to have minimum instances running on the layout. Other way would be not to move the rooms, but you'd need large layout.

  • Because I don't know if you could just crop it, or you got some objects on the sides. Depending on how you layed things out you could use different fullscreen modes. https://www.scirra.com/tutorials/73/sup ... reen-sizes