How do I add points to score in real-time without looping?

Get help using Construct 2

Post » Thu Nov 20, 2014 3:27 pm

Lordshiva1948 wrote:DoomEyes could be like this


Thank you for taking the time to do these demos. They are both partially correct. When the Bug object is not colliding with the wall, the points should reset to 0. That's the part I am having trouble with. :) Do you know how to do that? Thank you.
B
7
S
2
Posts: 34
Reputation: 670


Post » Thu Nov 20, 2014 5:44 pm

This is one way to do it.
You do not have the required permissions to view the files attached to this post.
B
252
S
39
G
15
Posts: 1,964
Reputation: 40,753

Post » Thu Nov 20, 2014 8:36 pm

Lordshiva1948 wrote:This is one way to do it.


Thanks for trying, but it's still not exactly what I want. If you don't have time for this, I understand, but the screens I pasted below are what I am trying to do. Thank you.

points.capx


screens.jpg
You do not have the required permissions to view the files attached to this post.
B
7
S
2
Posts: 34
Reputation: 670

Post » Thu Nov 20, 2014 9:10 pm

I do not understand how you want this? is what you want
You do not have the required permissions to view the files attached to this post.
B
252
S
39
G
15
Posts: 1,964
Reputation: 40,753

Post » Thu Nov 20, 2014 9:40 pm

You could do it as simply as this:
wall_points.png


but this would be updating the score every tick. Add some tracking variables and you get this. Maybe not much better
wall_points_better.png


Capx
wall_points_better.capx
You do not have the required permissions to view the files attached to this post.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Nov 20, 2014 9:53 pm

codah wrote:You could do it as simply as this:
wall_points.png



Thank you! This one worked exactly how I wanted. :D
I appreciate everyone's help here!
You do not have the required permissions to view the files attached to this post.
B
7
S
2
Posts: 34
Reputation: 670

Post » Thu Nov 20, 2014 10:10 pm

DoomEyes wrote:
codah wrote:You could do it as simply as this:
wall_points.png



Thank you! This one worked exactly how I wanted. :D
I appreciate everyone's help here!


Based on @Lordshiva1948 's hard work :)

edit: but I would still investigate ways of not having this do work every tick..
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Thu Nov 20, 2014 10:19 pm

codah wrote:
DoomEyes wrote:
codah wrote:You could do it as simply as this:
wall_points.png



Thank you! This one worked exactly how I wanted. :D
I appreciate everyone's help here!


Based on @Lordshiva1948 's hard work :)

edit: but I would still investigate ways of not having this do work every tick..


Thank you for the advice. How can I tell between the two examples you gave that one is running every tick and the other one isn't?
B
7
S
2
Posts: 34
Reputation: 670

Post » Thu Nov 20, 2014 11:32 pm

The 'is overlapping' is still running every tick (by necessity) , whereas an 'on collision' is triggered. What you should try to do is minimize what is done every tick, which is what my second capx tries to do. Always remember all non triggered events on your event sheet are run every tick.. and try to minimize them.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

PreviousNext

Return to How do I....?

Who is online

Users browsing this forum: hrisnz and 14 guests