megatronx's Recent Forum Activity

    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.

  • 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

  • ok, show a screenshot.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • That's a lot of coding to get that done. You got to use arrays, and prepare codes logic to calculate the outcomes for each step. Best thing for now for you would be to work in little bits and do each segment separately first. And plan the logic on paper first, it makes things more clear. That's as much as I can help you atm.

  • You need to double everything. And use layout the size of the resolution. Create two virtual screens on one layout, each height or with of half of the screen ( depending if you want to split it vertically of horizontally ). Create two players, and create two... lets call them shadows. You'll need two arrays, one per player. Also you will need to create some sort of virtual position checker, which will be checking relative position of each player in regards to their own virtual rooms. So lets say each room would have one sprite at the end of it that you can check relative position of the players. Ok, now, you will have to take players one relative position, and use it to set position of his shadow in another player part of the screen every tick.

    Ok, so we got all that, but now here's the biggest trick = you players stay in one place - they do not move! However everything else including shadows has got movement behavior with custom controls. Those controls are set in reverse, so when player hits right arrow, the whole level moves to the left.

    Hope that will help!

megatronx's avatar

megatronx

Member since 25 Sep, 2008

Twitter
megatronx has 1 followers

Connect with megatronx

Trophy Case

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

23/44
How to earn trophies