Colludium's Recent Forum Activity

  • Mmmmm - I must confess that I've had limited success with Global and have 'progressed' to creating the common game elements at the start of each layout. Are you able to share a capx so we can take a look? I'm sure that someone will be able to figure out why it's not working for you.

  • By default, all instances have Global set to Off - that is why they are destroyed between layouts as described in the manual. If you select Global to Yes in the Properties bar then you will achieve the effect you are looking for.

    I personally prefer to store all object properties in an array or variables as I find it easier to manage - because I then know exactly what characteristics are passed to the sprite each time the layout starts (enables a re-start or re-try option, for example).

  • michael,

    This should help I hope. Rather than place the arrow to a position on the gauge in such a complicated way, try the following:

    1. Put the arrow's origin to its center.

    2. Modify the every tick function on line 2:

        arrow -> Set Y to barBack.Y + arrow.Height/2 + (barBack.Height - arrow.Height) * (Scroller.Y - 384) / (LayoutHeight - Scroller.Height/2 - 384)

    This way you don't need to stretch a barProgress sprite (or even have one) and the above formula considers the playable height of the layout (-384 because your demo stopped with the Scroller in the middle of the screen: 768/2) and it also considers the height of the Scroller at start because its height slightly reduces the available playing area.

    Edit: It took me so long to type this out I see another option has been posted. Food for thought anyway I hope - regards, Ed.

  • Press F11 in chrome for full screen. With the bookmarks and tabs bars your project cannot be displayed the full width of the screen if it's 16:9....

  • Give your main object custom movement and put an invisible target object at each corner of the path. Give each target a variable that allows you to number them in sequence in the layout editor. Using events, pick the correct target by filtering for the correct variable value and then set your sprite to track towards it. Then, on collision with the target just as 1 to the target variable value, unless you're at the end when you reset to the start.

  • Errr - have you tried Event: On Click?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • tsugaruddr, are you able to post a capx example for us to have a look at? It's impossible to accurately guess what you might or might not have done to offer a solution.

  • OK, I've updated the capx and tutorial. Now you can select one of 2 groups in the capx. The first puts the shadows onto a separate and lower layer that has its opacity set as suggested by AnD4D (no darkening of shadows on overlap, but the shadows don't cast onto other objects). The second option group (enabled on capx download) puts all shadows and objects onto the same layer and order their z position according to y position so that the shadows do cast onto objects that are apparently underneath them. It's not perfect but much better, I think - thanks for the ideas.

  • AnD4D,

    Every day is a school day - and thank you for the help. I'll have a look at the easy fix now and update the tutorial - it didn't occur to me to manage the transparency that way (clever - I like it). The multi-layer option for shadow casting over other objects will require some thought on my part but it sounds good...

    Ed

  • Yeah, of course shadows with < 100 opacity will always add to each other if they overlap. I can't think of an easy way to improve on the current simple demo/tutorial without creating other problems or failings (with my limited skills, of course). Is there an easy fix you can think of or that you are hinting at when you say "should fix that" mindfaQ - any suggestions would be appreciated?

    Before writing the tutorial I had a good look at Pode's 2D Dynamic Lighting: but it doesn't produce shadows as far as I understand (and I'm happy to be corrected) and it requires the use of a 3rd party plugin (unsupported by Scirra in the event of an update causing a crash) and it requires the use of additional software that, as a hobbyist, I'm not familiar with nor inclined to learn how to use (I?m still learning how to use C2 when I?m not distracted by my day job).

    Thinking as I type - I suppose if the ground had a uniform fill colour with no texture effect then each shadow could be made from a darker shade of the ground's colour. Then shadow overlaps would not affect each other. However, that solution would obliterate any ground texture and, therefore, would be a viable alternative but with a huge trade off. Also, in situations with diffuse lighting in the real world, shadows can overlap and 'add' together - they are rarely exactly the same shape as the casting object unless you are very low to the ground... The same applies to situations with multiple light sources.

    When you mention that this only strictly applies to objects with a rotational symmetry about the z axis - I agree, the tutorial only demonstrates shadows cast by such objects. If you want to create complex shadow casting objects then I can?t think of an easy way to do it in C2, the only (and long) way I can think of would be to create a LOT of differently shaped shadow sprites and then select the appropriate one according to sun position and object angle. However, although I haven?t tried it, I imagine that you?d be on a hiding to nothing because it would be very hard to implement and still wouldn?t be as good as anything Unity could produce.

    I agree with your last comment: if you want a realistic 3D shading solution for your game, don?t use C2! But we?ve got to struggle on with the tools available...

  • Thank you very much for the kind comments! I got a bit bored this morning (jet lag playing havoc) and I needed a break from tinkering with one of my projects.

  • Link to .capx file (required!):

    link to capx

    Steps to reproduce:

    1. Open the capx and select Box2D asm.js physics

    2. Run Layout "L_Trial"

    3. Observe failure message

    Observed result:

    <img src="https://dl.dropboxusercontent.com/u/184657779/C2%20problems/physics%20failure%20r155.png" border="0">

    The layout only partially loads and then freezes showing the above error message.

    Expected result:

    Try this step first. Run the capx using Box2D web physics (DO NOT select Box2D asm.js) to see layout "L_Trial" run correctly (it's a simple car physics example using L/R arrow keys to move). This could be related to my other active physics bug report. This failure is fragile in that deleting one object, an animation frame or an array could cause the failure to disappear and not be repeated. This runs normally in Box2D web but, once you run this in asm.js there's no going back to Box2D web unless you reload the project (and haven't re-saved it).

    Browsers affected:

    Chrome: yes

    Firefox: yes

    Internet Explorer: yes

    Operating system & service pack:

    W7 Ultimate x64 SP1

    Construct 2 version:

    r155 x64

    Update - changed the title and some phrases for clarity

Colludium's avatar

Colludium

Member since 26 Aug, 2013

Twitter
Colludium has 11 followers

Connect with Colludium

Trophy Case

  • 11-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
  • x3
    Coach One of your tutorials has over 1,000 readers
  • Educator One of your tutorials has over 10,000 readers
  • RTFM Read the fabulous manual
  • Email Verified

Progress

18/44
How to earn trophies