How do I Allow a function to return the sprite picked?

Get help using Construct 2

Post » Sat Feb 21, 2015 2:35 pm

I've used many function in my project, but i never ran into the necessity to allow a function to pick an object previously picked by the condition of the event that called the function.

For example, i have:

Object is visible
Object overlaps Tree
-----> Call "lol" Function

Then, on"lol" Function, how can i tell the function to pick the previous Object sprite?

Sorry if this question has been asked previously, i can't manage to find anything that i could understand, and my team mate (who is more seasoned with C2) is unavailable!
B
61
S
21
G
4
Posts: 354
Reputation: 6,347

Post » Sat Feb 21, 2015 2:39 pm

you can add an uid (the one of the sprite picked) as a parameter, then you just use the sprite condition "pick by unique id" and specify said parameter.
Game design is all about decomposing the core of your game so it becomes simple instructions.
B
48
S
21
G
18
Posts: 2,113
Reputation: 16,875

Post » Sat Feb 21, 2015 3:01 pm

Alright, i swear i've never seen "add parameter" and i was going crazy! Solved, thanks!
B
61
S
21
G
4
Posts: 354
Reputation: 6,347


Return to How do I....?

Who is online

Users browsing this forum: ismael123, MTR, tikuna, Yahoo [Bot] and 11 guests