marching in step...(solved)

Discussion and feedback on Construct 2

Post » Thu Mar 31, 2011 3:57 am

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... [url:cc7nvhqr]http://dl.dropbox.com/u/6707683/construct.../barney%20march%20test.capx[/url:cc7nvhqr]

thanks for any help...
B
50
S
17
G
15
Posts: 1,029
Reputation: 26,289

Post » Thu Mar 31, 2011 9:41 pm

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.
B
51
S
10
G
7
Posts: 184
Reputation: 6,825

Post » Thu Mar 31, 2011 10:54 pm

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...
B
50
S
17
G
15
Posts: 1,029
Reputation: 26,289

Post » Fri Apr 01, 2011 1:54 am

"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 ?

[url:31tmbz2j]http://dl.dropbox.com/u/22173473/space%20invader%20example.rar[/url:31tmbz2j]
B
19
S
6
G
7
Posts: 1,204
Reputation: 7,296

Post » Fri Apr 01, 2011 2:15 am

[quote="harrio":1zg50eoq]sorry you could not open the cap. did i link the wrong file? is anyone else having a problem opening the cap?[/quote:1zg50eoq]

It says Background.png is missing. Sorry for not clarifying that.
B
51
S
10
G
7
Posts: 184
Reputation: 6,825

Post » Fri Apr 01, 2011 2:36 am

[quote="Yarfapet":38ovx193][quote="harrio":38ovx193]sorry you could not open the cap. did i link the wrong file? is anyone else having a problem opening the cap?[/quote:38ovx193]

It says Background.png is missing. Sorry for not clarifying that.[/quote:38ovx193]

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


I have the same error message when trying to open the cap?
B
19
S
6
G
7
Posts: 1,204
Reputation: 7,296

Post » Fri Apr 01, 2011 3:05 am

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.
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Post » Fri Apr 01, 2011 3:23 am

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.
B
50
S
17
G
15
Posts: 1,029
Reputation: 26,289

Post » Sat Apr 02, 2011 4:02 pm

for anyone who may be interested...

[url:500tapiz]http://dl.dropbox.com/u/6707683/construct.../barney%20march%20test%202.capx[/url:500tapiz]

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.
B
50
S
17
G
15
Posts: 1,029
Reputation: 26,289

Post » Sat Apr 02, 2011 4:29 pm

Glad you got it working. Just thought I'd mention that most conditions are actually 'if' statements, though. :)
Moderator
B
87
S
32
G
33
Posts: 3,005
Reputation: 27,397

Next

Return to Construct 2 General

Who is online

Users browsing this forum: blackant, newt and 1 guest