dop2000's Forum Posts

  • Here you go:

    https://www.dropbox.com/s/mune0lb1tfl7s ... .capx?dl=0

    I left green and blue sprites semi-transparent, but they of course should be invisible.

  • Could you share your capx?

  • Are you using 8-Direction? I think with 8-Direction you can make the same kind of movement, just read gamepad axes and emulate controls.

  • Man, I love F1!

    Not sure if this is 100% correct, but this quick fix seems to work - add "Else" condition:

  • I used the same example - 640x480 map with about 30% fill.

    I also tested with only two colors, selected them at random (like a white noise). The result is pretty much the same - less than 1fps. So it's not the number of colors that matters, but how they are placed.

    I think C2 optimizes performance for tilemap - when there are lots of identical tiles grouped together, they are treated as one big tile or something like that.

  • matriax

    I tested the tilemap with 256 colors - it's insanely slow, less than 1fps. When each building is one uniform color, it's fine. But if each pixel is a different color, everything comes to a halt. So forget this idea.

  • It's very easy to test - create a project with one sprite, run it in Debug Mode, note the memory and cpu usage.

    Then create an event: "repeat 200 times -> create sprite at random x,y"

    Run again in Debug Mode.

    You'll see that memory and cpu usage values are exactly the same!

    Of course if these sprites are moving, fading, resizing, colliding etc., then the large number of sprite instances with have effect on the CPU usage.

  • I may not fully understand what you are trying to do, but why don't you destroy canvas objects after you build your tilemaps?

    You can go even further - create a tilemap with a 128 or 256 colors pallet, convert your sprites to tilemaps on start of the game using canvas, and then destroy all sprites and canvases, keeping only the tilemaps.

  • Your game Doptrix is AWESOME I thoroughly recommend it!

    Thank you! Yes, it's pretty awesome and I'm really proud of it

    I know people who play Doptrix for years, some say it's their favorite mobile game.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Ok, I'll tell you my secret how to become an expert in C2

    When you are adding/editing an action, there should be a semitransparent window somewhere on the screen - "Object with expressions". If you don't see it, press Ctrl-F4.

    Explore everything in this window, it lists all expressions for all objects. The most useful one is System, but others also contain lots of interesting stuff.

    That's it That's my secret - I know where to lookup expressions. And now you are an expert too!

    And no, I don't know javascript

  • Your words in the array start with line break.

    Just add trim() to remove all invisible characters (spaces, line breaks) from the beginning and end of the string.

    Also you can replace "i" with loopindex:

  • draiza

    Sorry, I was wrong. Gamepad number is the first parameter of Axis expression:

    Gamepad.Axis(0,1) - means gamepad #0, axis 1

    Gamepad.Axis(3,2) - means gamepad #3, axis 2

  • Anonnymitet

    Yeah, I don't understand why there is no expression to get gamepad number.

    I guess for events like "On key pressed" you'll have to create 4 identical events for each gamepad number. Then redirect them to a function, like this:

    On Gamepad 0 button A pressed -> Call Function ("Jump", 0)

    On Gamepad 1 button A pressed -> Call Function ("Jump", 1)

    For events like "Is button down" you can test all gamepads in a loop.

    By the way, "On gamepad .." events are not very reliable, they can miss buttons if several buttons are pressed simultaneously. Some time ago I made a little engine that only uses "Is.." events, see this post:

    It can be modified to support multiple gamepads.

  • There are many ways to do this.

    Since you are using Flash, simply add condition "Is NOT flashing" to the event where you subtract health.

    (add "Is flashing", then right-click and invert)

    Enemy->Is overlapping Player    Player subtract 10 from Health
    Player->Is NOT flashing
    [/code:2ijy9678]