silkc2's Recent Forum Activity

  • Hiya

    I am creating a level based game. I don't want to clone the (rather complex) interaction/touch events into each level's event sheet because that would mean I have to maintain code in many places going forwards - a logistical nightmare as any coder knows.

    ..Nor do I want each level to share one event sheet as it just isn't practical due to different game modes, tutorials, and different objects and backdrops to handle as the levels progress.

    Is there any way at all that I can have some code be re-usable in all event sheets? I already have the code in question grouped up into an "interaction" group.

  • I didn't realise it would assume those one is paired (and that it wouldn't align it like it does all the others).. oops!

    I found that creating them at runtime eliminates the problem anyway.

    Thanks. :)

  • Hi all!

    See here for sample:

    dl.dropboxusercontent.com/u/116137178/Help/HelpmeWithtextContainers.capx

    I am trying to get text boxes to automatically have a solid / patterned background. From what I've read about containers they should be perfect for this, and from playing around with origins and setting z order I'm almost there - but the background doesn't appear at all for the first text box.

    Any idea why this would be?

    Should I be using pin instead of containers anyway?

  • Any joy?

  • What, how to declare a variable or the logic you could use around one?

    Just right click event sheet, add global variable.

    It's then global to all event sheets, not just the one you create it on.

    So with that in mind.. one way to make it work..

    Curr level layout start - assign global variable to "Layout1"

    On victory load "you win" layout

    On "you win" layout, check the global variable (system>compare variable). If it is "layout1" then load "Layout2". If it is "Layout2" then load "Layout3" and so on.

    If you are using numbered layouts as above, you can massively cut down on the events by storing level number, adding 1 to it, and concatenating your new name then use System>Load Layout by name.

    e.g.

    1, My layouts are called "MyLevelX" where X = level number

    2, I load level 2. My global "LevelNo"is set to 2. I beat level 2.

    3, In my "victory" layout I load the next layout by name simply as "Mylevel" & LevelNo+1 (which makes a string "MyLevel3" in this case).

  • I wonder the same things.. especially about copyright.. anyone?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • OK thanks very much, just trying to get a full understanding. :)

  • Well even if it isn't a loop same question stands;

    Create an object in event 20

    Handle creation in event 100

    Does c2 jump down and up?

    Conversely:

    Create an object in event 100

    Handle creation in event 10

    Does c2 jump up then down? ;)

    I guess simply put are the created/destroyed events independent of event ordering..?

  • Hiya

    I am just curious to know when exactly does "On Created" get called?

    For example if you have Event#10 looping around and spawning objects, and those objects have an "On Created" much further down say event #100. What happens? Does it "jump" to event 100 then back to 10 (the loop) per created item?

  • Agreed - you are better to post this in construct2 general, though.

  • Yeah I get that too, must be a bug I somehow found in c2. Have lost everything I just did then, nice. :/

    Anyway the concept is:

    1, Enemy animation 1 - make collider smallest line possible at bottom of sprite

    2, Enemy animation 2 - make collider full size as normal

    3, Pin an invisible larger box around player

    4, When enemy overlaps that box, set enemy animation to 2

    5, When enemy not overlapping box, set animation to 1

    Basically the flat collider lets them pass each other, then they get bigger colliders when near a player.

  • Yeah I see the issue.

    You are setting the particle to not spray but you aren't picking out one, so it'll do them all.

    You need a nested foreach under the foreach firework. And you use "PinnedUID" on the particle to compare to parent UID.

    Pseudo code:

    For each firework

    Firework moving down? Set Flipped

                          Set Mirrored

                          Move to Layer 2

    For each particle

       Particle.PinnedUID = Firework.UID? Set not spraying

    Also one minor tip, you can spawn particle from firework.. simply saves having to specify an x and y position using system to spawn it.

silkc2's avatar

silkc2

Member since 28 Jan, 2013

None one is following silkc2 yet!

Trophy Case

  • 11-Year Club

Progress

11/44
How to earn trophies