Tips needed to create simple mechanism

Get help using Construct 2

Post » Fri Sep 26, 2014 5:28 pm

Need something similar to that http://www.gry.pl/gra/zagubiona-owca

How its best way to create that folding of parts the road?

1st thing i use drag & drop
but i need tips how to connect parts of road (i have one idea but im afraid its too complicate to make it quick)
B
110
S
27
G
47
Posts: 1,887
Reputation: 35,799

Post » Fri Sep 26, 2014 5:58 pm

i have got an idea :

make 2 images points for each road part , the first is the man image point (0) call it (bottom) and place it in the beginning, add another image point (1) call it "top" and it's obvious place it in the end of the" part. give each part a value call it order(integer) to test if the roads are correctly ordered or not .

then when you drage and drop a road part , make a test

if that sprite_level1_part2.order = sprite_level1_part1.order + 1 then {
- set the position of sprite_level1_part2 to other object at image point "top" or (1) .
// construct 2 will place the sprite based on it's principal image point so it will be in the right position
}
else if the sprite_level1_part2.order # (Not equal to ) sprite_level1_part1.order + 1
then place it back to it's original position.

i didn't try this i just hade it in my minde , i hope it works as i thought.
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Fri Sep 26, 2014 6:05 pm

@warville i think your idea about image points its big step for me i will check this right now
B
110
S
27
G
47
Posts: 1,887
Reputation: 35,799

Post » Fri Sep 26, 2014 6:18 pm

i know what is missing for me. I need only condition When Sprtie.road. Animation frame0 (with variable called 'part' = 1 ) is overlapping Sprtie.road with Animation frame1 (with variable called 'part'= 2 ) > set position to another object Sprtie.road.

How make that condition ?
B
110
S
27
G
47
Posts: 1,887
Reputation: 35,799

Post » Fri Sep 26, 2014 6:29 pm

i don't understand what you are trying to do ? why you need different frames ? just differents sprites ! using instance of the same sprite is complicated because you can,'t make condition (is overlaping) on instances of the same sprite it's very complicated.
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Fri Sep 26, 2014 6:31 pm

@warville different frames because Sprite Road have in his animation many road part (frames)

I add screenshot, this should work. Of course first and second part of my road have this same variable value 'road =1' to connect andt dont work. wierd
'part' is variable of road sprite
You do not have the required permissions to view the files attached to this post.
B
110
S
27
G
47
Posts: 1,887
Reputation: 35,799

Post » Fri Sep 26, 2014 6:46 pm

What you have made is strange. Please try to do it as i suggested. Make different sprites for each part part1 part2 part3 and don't forget to set position on other sptrite on image point(1) not (0) because 0 is used already in the previous one.
B
12
S
6
Posts: 118
Reputation: 1,466

Post » Fri Sep 26, 2014 6:54 pm

@warville thanks for your tips i think will be better when i use One sprite (with animation frames) to one level because if you import separated parts(15-30 parts) for each level imagine how many will you have to import to 10 levels.
B
110
S
27
G
47
Posts: 1,887
Reputation: 35,799

Post » Fri Sep 26, 2014 6:54 pm

Maybe my tutorial/example will help.

Drag & drop Correct Place

Personally I wouldn't use different sprites as each road. Use animation frames for the roads as you have done but use a copy for detecting if it's in the right place.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Fri Sep 26, 2014 7:03 pm

@Minor thanks, that 'draghere' sprites to check is old and well checked method, im wondering why my condition on screenshot dont work?
I attach my capx maybe some one take a quick look and come a good idea of ​​what need to be improved in code
You do not have the required permissions to view the files attached to this post.
B
110
S
27
G
47
Posts: 1,887
Reputation: 35,799

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 26 guests