marching in step...(solved)

0 favourites
  • 12 posts
From the Asset Store
Step into the shoes of a brave commando on a mission!
  • hello everyone,

    my problem may exist simply because i may need global variables, or some other nuance as not yet included in c2. so i'm asking if any of you know as much to be true.

    i have some enemy actors simulating 'space invader' movement. as they incrementally approach invisible barriers on either side of the screen, they are suppose to drop down in unison, and reverse course. i've got them to move incrementally, and to reverse course in unison, by sort of faking global variables, by creating the movement variables in the background sprite. but the enemies won't drop down in unison. only the enemy that 'collides' with the barrier actually moves down.

    i suspect this is some kind of 'picking' issue. but i don't know much about picking rules. i'm still very new to the engine. so i would appreciate someone letting me know if i am just doing it wrong, or if it is something that has to wait for an update before i can complete it.

    cap file... http://dl.dropbox.com/u/6707683/construct.../barney%20march%20test.capx

    thanks for any help...

  • Couldn't get the file to open. But here's what I'd do:.

    Make another variable in the background. When one hits the wall, set it to one. Then have that variable equal to 1 Move down and reverse direction. Set to zero.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • sorry you could not open the cap. did i link the wrong file? is anyone else having a problem opening the cap?

    instead of the fake 'global' variables i did, i'm going to try a sort of fake 'state' engine, which will be similar to what you suggested yar.

    i'm going to have one text variable attached to the background sprite with the possible values of 'left, right, down' and i'll have different events for those values, which i hope 'all' of the enemy sprites will obey...in unison.

    thanks for the suggestion...

  • "i have some enemy actors simulating 'space invader' movement. as they incrementally approach invisible barriers on either side of the screen, they are suppose to drop down in unison, and reverse course"

    Here's a very simple SPACE INVADER clone i made in Construct 99.6 (i think)

    You might be able to adapt the events to work in Construct 2 ?

    http://dl.dropbox.com/u/22173473/space%20invader%20example.rar

  • sorry you could not open the cap. did i link the wrong file? is anyone else having a problem opening the cap?

    It says Background.png is missing. Sorry for not clarifying that.

  • > sorry you could not open the cap. did i link the wrong file? is anyone else having a problem opening the cap?

    >

    It says Background.png is missing. Sorry for not clarifying that.

    ---------------------------------------------------------------------------------------------

    I have the same error message when trying to open the cap?

  • The problems opening it are because you posted a .caproj instead of a .capx. A .capx is basically a zip file with all the resources included, which is why it isn't finding the image. When the project is open, use 'save as single file' to save it as a .capx.

  • got it...thanks arima.

    i apologize to everyone who took time to help, only to be hindered by my boneheadedness.

    edit: i changed the link to the capx file for anyone morbidly interested.

  • for anyone who may be interested...

    http://dl.dropbox.com/u/6707683/construct.../barney%20march%20test%202.capx

    it's not as if this was some great problem or bug that needed a solution, and the main reason it took me a while to get it right was because c2 simply doesn't have all the conditions that would have made it simple...yet. like "if", "else" or "or".

    but, as a noob with any engine, i usually start with implementing space invader movement to gauge how easy the software is to learn, and how simply it can create this straight forward movement type. and without being complete, it got the job done.

    i ended up having to separate the enemy movements from the side barrier collisions, to get around the picking thing. and i had to check for 'down' first, separately from the left/right checks. i also had two variables tracking movement; enemy_direction was a text variable that tracked down/left/right, while enemy_interval tracked just the left/right interval.

    so there you have it. a whole lot of hulabaloo over something not that important. but i hope it might be of some help to other noobs.

  • Glad you got it working. Just thought I'd mention that most conditions are actually 'if' statements, though.

  • yeah, i was too lazy to change that. i actually meant the conjunctions of 'if/else' and 'and/or'. hope i did not confuse any noobs.

    and if anyone sees a cleaner/more elegant way of making it work, i'll be glad to see it. every little bit helps when you're learning new software.

    and thanks again for helping me with the 'capx' thing.

  • i realized after i separated the enemy movement from the collisions with the side barriers, that i did not even need the side barriers.

    i replaced the checks for barrier right/left collisions with math conditions; enemy.X >= 600 or enemy.X <= 40, and it worked the same.

    less resources for the same functionality is always better i suppose.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)