linkman2004's Forum Posts

  • As MadSpy said, the expression LayoutName will return the name of the current layout, which you can see in the manual.

  • The events are automatically run once per frame. There's no need to setup an explicit game loop.

  • I wouldn't recommend using dt in a lerp function like that, as it's likely not doing what you think it is. If your FPS -- and by association, the value of dt -- starts to fluctuate, you'll find your camera jumping around. If you want smooth camera movement with dt, you should be lerping the camera position toward a fixed point between the player and mouse.

    Alternatively, you could look at my Magicam plugin, which does motion smoothing and multi-object following.

  • Just set your camera's position to the average position between your player and the mouse. Something like:

    X = (Player.X + Mouse.X) / 2

    Y = (Player.Y + Mouse.Y) / 2

    If you want to get fancy and control where in between the two your camera lies, you can use lerp:

    X = lerp(Player.X, Mouse.X, 0.25)

    Y = lerp(Player.Y, Mouse.Y, 0.25)

    This specific example would place the camera 25 percent of the way from the player to the mouse.

  • Strings(text) need to be enclosed in double quotes, so you would put "NINJA" instead of NINJA.

  • Running in debug mode comes with additional overhead, which can result in decreased performance. When you export your game, it won't be running in debug mode, so you'll be fine.

  • Effects tend to bring performance down, some more than others. This is especially true on mobile devices. You may have to do without the effect, or perhaps limit its usage.

  • Give the object two instance variables, oldX and oldY. Every tick, set oldX to Object.X and oldY to Object.Y. To check if Object is moving, in an event before you update oldX and oldY, check if oldX is different from X OR oldY is different from Y. If one of the two is different, Object has moved.

  • There's no circle tool. The built in image editor isn't really intended for serious graphics creation. If you want better tools, it's better to make your graphics in something else -- Photoshop, GIMP, Paint.net, etc -- and import them intro C2.

  • It's not possible to store objects in the aforementioned data structures. You'll have to find some other way to do what you want.

  • Using detector sprites really isn't the best way to go about this. I've included a modified version of your file that performs most of the heavy work with a 2D array. I tried to make the comments explain what's going on as clearly as possible, but let me know if you need any more explanation.

    Dynamic Road Stitching

  • When the player touches the screen, create an object at the location:

    X: floor(TouchX / (LayoutWidth / 6)) * (LayoutWidth / 6)

    Y: floor(TouchY / (LayoutHeight / 6)) * (LayoutHeight / 6)

    I don't have access to C2 right now, so I'm unsure of the exact expression names, but this is the general method.

    EDIT: For the record, this presupposes a sprite with the origin in the top left.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • 1. Check the value at (LevelNumber, Difficulty) -- using a comparison -- before setting the new score to that location.

    2. Zero indexing has nothing to do with size. An array of width 3 would have three columns, at indices 0, 1, and 2. If your level and difficulty numbers start at 1 -- that is, they're one-indexed -- then a score's corresponding location in the array would be (LevelNumber - 1, Difficulty - 1).

  • I doubt there are any rules against it -- you'd have to look at Google's terms of service to get a definitive answer for that -- but I also doubt this would actually work. According to this article, the number shown on the store is a count of the number of unique users who have ever installed the app.

    So you could download the app all you want, and you'd see total installs on the developer console go up, but it wouldn't change the number shown in the store. Even if it did, it would take an exorbitant amount of time to reach a number that would be capable of influencing people.

  • You can either use the grayscale effect that comes with C2 -- which will result in darker colors than your example -- or you can use the new "Max Grayscale" effect I created, which sets all color channels to the value of the highest channel, giving a result more or less identical to your example. Just extract the zip into your C2 effects folder.

    Download Max Grayscale