How do I add object?

Get help using Construct 2

Post » Wed Jun 18, 2014 2:30 pm

That randomly chooses either 1,2,3,4,5,6 or 7 to add to your score.

I used it for 2 reasons:

1. I have no idea how your scoring works so it was easy for me to make for the example.
2. It shows that whatever you add to your score every 10 point's will create an object.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Wed Jun 18, 2014 3:00 pm

tnk you in advance

I'd like to understand how it works .. the reasoning .. but I can not understand .. so I would love it if you did a tutorial explaining step by step what to get and why ...

for example

i have already insert a global variables name score... but no understund why you use another global "point and object_create"
B
5
Posts: 32
Reputation: 289

Post » Wed Jun 18, 2014 4:10 pm

Hey @lowkicker, what Minor did is really easy, I think you should stop by the tutorials section to learn a little bit more about the basics of Construct 2.

Minor created two variables (score, object_create) where the score is stored and one where the points that will be added to the score are stored (points), he is using object_create to check if the score is greater or equal to 10, when than happens 10 points are substracted from object_create so that the system can evaluate that condition again. You could skip the usage of the points variable, but it's always better to have variables to store things like that, so you know where things that modify your score or another important things of your game are.

The problem with MY example is that only one instance of the object is created and the condition is never evaluated again.
B
21
S
5
G
3
Posts: 53
Reputation: 3,335

Post » Fri Jun 20, 2014 12:31 pm

yes @donelwero but i am a totally noob.. for me every day is a miracle^_^

@Minor no working your solution i thin because you use every 1 second..

at me every "1 second" give me random 1 2 3 4 5 6 7 points...
B
5
Posts: 32
Reputation: 289

Post » Fri Jun 20, 2014 12:53 pm

Like I said I have no idea what type of game you are making, how your scoring works or how many points you get for doing anything.

I used "every 1 second" because it let me add a number of points to a score which then let me show you how to create an object for every 10 points scored. What you need to do is include my method of checking for "every 10 points" into your game & scoring system.

With the information given neither myself or anyone else can do any more to help.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Fri Jun 20, 2014 1:05 pm

ok @Minor sorry for my forgotten...
when my main sprite bounce on the platform give me 1 point.. and when i collect 10 point give me a gold and when my ball take a gold gold give me 5 point...
this gold is a obect i want create.... ok?
please @Minor help me

I do not know but this reasoning to translate it into script

everytime gain 10 score create this object...
last part i know... "create this object"
B
5
Posts: 32
Reputation: 289

Post » Fri Jun 20, 2014 1:29 pm

You need to add a new variable like in my example and call it "object_create". Whenever you add points to your score also add it to this variable. So for every time bounce you add 1 to "score" and 1 to "object_create".

Like in my example compare when "object_create" is equal or greater than 10. Create your "gold object" and then subtract 10 from "object_create".

I can't do any more really you have my working example you have to add that to your game.
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

Post » Fri Jun 20, 2014 2:15 pm

ok tnk you i have resolved with your system 2 global variable
B
5
Posts: 32
Reputation: 289

Post » Fri Jun 20, 2014 3:55 pm

Dear @Minor only one question... when i launch a game with a run layout button i have zero score ok???
because they appear just 4 items that I entered? I state that everything works now except for this thing ...
B
5
Posts: 32
Reputation: 289

Post » Fri Jun 20, 2014 4:00 pm

Sorry I don't quite understand what you mean.

Shouldn't your score be 0 at the start?
B
46
S
23
G
7
Posts: 459
Reputation: 6,763

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests