[maybe reopened]How do I - single Sprite 4x, multiple states

Get help using Construct 2

Post » Fri Nov 07, 2014 6:28 pm

Hi community!

I think I can you explain it the best when I "convert" my needs into a garden. First off a sketch from my situation (ignore everything drawn in brown at first):
(you may have to view full image, its a bit bigger)
Image

You got 4 flowerpots. Its the sprite "sprite_flowers" [green things in image=the sprite // the number beside each sprite represents its animation (which ll contain frames, but thats not important for now]. Those 4 pots are placed at a fixed position.

In this example we have 3 different seeds. Everyone of them takes another time to grow. Flowerpot #1is empty, #2, #3 and #4 are not.

60 seconds after you tapped the seed and planted it into pot #2, the flower will be full grown.

#3 will be set at animation 3 after 40 seconds and after another 80s it will be set to 4.

Same with pot #4, except that it contains 3 states untill it is grown.


What I need to know:
The "selection" what goes where is asked In a:
Code: Select all
{Touch > on touched sprite_flowers
 { sprite_flowers > is animation "empty" playing
 { sprite_flowers set animation to state1 }}}

This is stored in a group which is activated after selecting the flower you want to grow and deselected after successful placing.

What do I have to do to start a timer which is started when the touch "on empty pot" is done (I wanted to make an array containing informations about the flowers, especially the "growtime") pointing at the sprite I selected? I messed arround in hoping with "is touched" element to store information about what is pressed to give it a "unique" ID or something for letting the timer point at it, but it doesnt even worked a little as wished.

Regards,
Proxymity


Edit: I thought about making 4 different sprites, all containing the same animations but It ll be a bit easyer to manage the state and things, but I dont know if adding them to a container could be reduce the sourcex4 (with 4 sprites) to a single one. Inheritance is possible with families but is it also possible to really reduce the sourcecode to a "single" function/event/group making it valid for all 4 sprites?
Last edited by Proxymity on Sat Nov 08, 2014 2:59 am, edited 1 time in total.
B
24
S
15
G
9
Posts: 118
Reputation: 6,864

Post » Fri Nov 07, 2014 7:31 pm

Rexrainbow some some really useful timer plugins

check out
http://c2rexplugins.weebly.com/rex_timer.html

and

http://c2rexplugins.weebly.com/rex_duration.html
B
90
S
44
G
17
Posts: 1,012
Reputation: 18,527

Post » Fri Nov 07, 2014 7:36 pm

justifun wrote:Rexrainbow some some really useful timer plugins

check out
http://c2rexplugins.weebly.com/rex_timer.html

and

http://c2rexplugins.weebly.com/rex_duration.html


Now I regret not spending time to study most of the plugins.. thanks for this information, that will save me a lot of time!

Regards,
Proxymity
B
24
S
15
G
9
Posts: 118
Reputation: 6,864

Post » Fri Nov 07, 2014 7:54 pm

............
You do not have the required permissions to view the files attached to this post.
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Fri Nov 07, 2014 8:12 pm

korbaach wrote:............

This covers everything I wanted to know, thanks for that! ..I think Im still thinking a bit too "complex" or "dispositioned" for C2 :s

Regards,
Proxymity
B
24
S
15
G
9
Posts: 118
Reputation: 6,864

Post » Fri Nov 07, 2014 8:23 pm

No Programming Required!
You can now make advanced games without writing a line of code. Construct 2 does the hard work so you don't have to.

Our highly intuitive event system makes putting your games together quick and easy.

:D :D :D
B
67
S
24
G
7
Posts: 1,518
Reputation: 11,072

Post » Fri Nov 07, 2014 8:32 pm

korbaach wrote:No Programming Required!
You can now make advanced games without writing a line of code. Construct 2 does the hard work so you don't have to.

Our highly intuitive event system makes putting your games together quick and easy.

:D :D :D


Sounds a bit stupid, but I encountered a few problems (especially) when I first tryed Construct2 becuase Im thinking to difficult and not getting a solution because of that.. the last time I "really programmed/learned it" was about 10 years ago with C, learned it because the lack of games for OSX (and 9, days back) and so I wanted to make my own ones... If Ild had C2 back then... whew... :D... C2s logic is literally "too easy" for me to get to it in the first thought... Ashley needs to add support somehow for guys like me :D

But yes, C2 is far the best way to make things done Ive found in a whole while.

Thanks again,
Proxymity ;)
B
24
S
15
G
9
Posts: 118
Reputation: 6,864

Post » Sat Nov 08, 2014 2:58 am

korbaach wrote:............


One another question: does switching the layout kills the "wait" action? Is there a "workarround" (preferable without saving current time to variables or other stuff without using plugins, if not needed)? Havent found anything here https://www.scirra.com/tutorials/56/how ... ion?page=2 :s

Regards,
Proxymity
B
24
S
15
G
9
Posts: 118
Reputation: 6,864


Return to How do I....?

Who is online

Users browsing this forum: dop2000 and 19 guests