Allbrotnar's Forum Posts

  • I haven't used it myself, so I'm not terribly helpful in this regard (sorry), but you'll have a decent chance of understanding it by reading is subforum here. I can't link you to it, but you can find it in the Completed Addons board.

  • Check out the Canvas Plugin, this might help you out:

  • At first I dismissed your comment since I had tried making them fully opaque before, and the player character was indistinguishable, since everything was black.

    But your comment did give me the idea of adding the atmospheric haze as separate sprites that change opacity depending on what time of day it is (just like the background does). And, since I messed with the opacity formulas a little bit, it actually made the sunrise and the sunset look a lot better, so thank you very much for the suggestion!

    So, yeah, masking seems to be a bit tricky at the moment, so I'm just going to rely on good old opacity. I do hope some more in-depth functionality gets added soon.

    Cheers!

  • You can make it so when the player interacts with the object, set the enemy's position to Player.X and Player.Y

    You might want to make it something like Player.X+10 or something like that so the enemy doesn't land directly on top of the player (unless that's what you want to do). Hope this helps

  • Hello everyone,

    I've been trying to figure out this problem for a while now and I can't find any solution to it.

    I'm making an endless runner that's based on silhouettes. For the background, I've made some terrain sprites that are basically gradients, so the amount of black won't be too overbearing. What I'd like to do (and starting to think isn't possible at all) is for the sun to not be visible through the terrain, like it is now:

    I've tried to do this the way I've seen some people do alpha masks for lighting, but it didn't work at all...Any ideas?

    EDIT: Attached example .capx: [attachment=0:2pel9qyf][/attachment:2pel9qyf]

    Awesome! I've fiddled around with the math a bit more, just had to take emoaeden 's expression (and change it to WindowWidth instead of Layout for the big 3200 layout) and add 250 at the end of it to centre it more. Thanks a lot, guys!

    I'd like to bump this old thread, as well. The expression is incredibly useful, but I can't get it to keep my sun within the layout.

    My layout is 1600 by 900. I want the sun completely within that layout throughout the day, but whenever I change the X expression, it ends up being left-aligned rather than centred. Any of you guys have any ideas?

    Here's the layout with the basic elements: [attachment=0:iaw3grlp][/attachment:iaw3grlp]

  • Thanks for the help, Windwalker, but I'm still not sure how to change it in a useful way for my project. Gonna try a few other ways of getting the effect I wanted, thanks again!

  • I don't see a "value" property where I can change the formula...Any chance you could provide me with an example?

  • Hello, I hope you guys can give me some insight into how I can make this work...

    I'm trying to make a day/night cycle by moving gradients up and down, depending on the time of day (which, in turn, is determined by the rotation of the sun and moon). So, for example, at 7 o'clock, the sun sprite is at105 degrees, the sun is coming up, and red gradient moves up to indicate dawn.

    I figured, since red comes up twice (at dusk and dawn), it has to move according to a function. I plotted red's Y value against time of day, and got a function out of it from a graphing calculator. I rounded the values a bit and tested this graph, and it was close enough.

    So in the event sheet I used

    Every tick - Sprite2 - Set position to ((744.3*(sin(0.5*TimeOfDay+1)))+1271.1)

    And yet it does not move at all...I used the layout debug build and saw that it does, in fact, move, but very small amounts. Any clues as to why that might be happening?

    EDIT: Here's the capx:[attachment=0:20zzzuq5][/attachment:20zzzuq5]

  • Hey, thanks for the awesome plugin! I'm fascinated by the Gradient Fill and how it works, but is there any way to have 3 cycling colours dependent on time of day (the sun's rotation for example)? I'm trying to get a controllable day/night cycle going. It might well be impossible from where I'm standing, but I would love to be proved wrong.

    The maths might just be beyond my comprehension here

  • Excellent, thanks very much!

  • Thanks for the reply, but that didn't seem to work.

    Here's a .capx with the broken mechanic:

    dropbox.com/s/y6yii2dbbb1q4hd/EndlessExample.capx

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hello,

    I've been trying to get random objects to spawn in an endless jumper type template, by spawning it at a random frame.

    I used this expression:

    Sprite   | Set animation frame to int(random(3))

    to test out the first 4 objects, but it doesn't work. It doesn't even show the frame 0 sprite, but it spawns frame 3 every time. I've also tried changing the random value to (random(0,3)) in case it was a range, but that also spawns the last frame constantly. Changing the initial frame of the animation also has no effect.

    Any ideas?

    Cheers!

  • Have ditched physics almost entirely, at least for the paddle and ball.

    My problem now is with the spring that launches the ball. I can't post links yet, so I'll do my best to explain the setup.

    The spring moves down by pressing the Down key. Each pixel adds 1 to its Movement instance variable.

    When the Down key is released, the spring reverts to its original position, the Bullet behavior is enabled on the Ball, which bounces off the spring. This launches the ball successfully.

    I've implemented a reset key for when the ball accelerates too much and goes through the level barriers. This puts the ball in its original place on top of the spring, disables the Bullet behavior and sets its Bullet speed and acceleration to 0.

    When I reset and relaunch the ball, it simply disappears off screen. If I reset it one more time and try to launch it again, I also get a big javascript error and the same thing happens.

    This is the error:

    Assertion failure: Bounce normal computed as NaN

    Stack trace:

    assert2@http://localhost:50000/preview_prelude.js:12

    Runtime.prototype.calculateSolidBounceAngle@http://localhost:50000/preview.js:3773

    Acts.prototype.Bounce@http://localhost:50000/Bullet_behavior.js:291

    Action.prototype.run_object@http://localhost:50000/eveng.js:1644

    EventBlock.prototype.run_actions_and_subevents@http://localhost:50000/eveng.js:850

    EventBlock.prototype.run@http://localhost:50000/eveng.js:807

    Runtime.prototype.executeSingleTrigger@http://localhost:50000/preview.js:3998

    Runtime.prototype.triggerOnSheetForTypeName@http://localhost:50000/preview.js:3917

    Runtime.prototype.triggerOnSheet@http://localhost:50000/preview.js:3850

    Runtime.prototype.trigger@http://localhost:50000/preview.js:3811

    instanceProto.onKeyUp@http://localhost:50000/Keyboard_plugin.js:130

    instanceProto.onCreate/<@http://localhost:50000/Keyboard_plugin.js:60

    x.event.dispatch@http://localhost:50000/jquery-2.0.0.min.js:4

    x.event.add/y.handle@http://localhost:50000/jquery-2.0.0.min.js:4

    Why doesn't it relaunch at the normal speed?