[Solved] How do I do a good coin pick system?

Get help using Construct 2

Post » Sat Jun 20, 2015 4:31 am

I making a system that the player have collision with a coin that have as instance variable his value, and this value is saved in Local Storage. But when I restart layout, the coins return to save position. How do I pick coins and permanently destroy them using Local Storage? Thanks in advance :D
Last edited by DaniellMesquito on Wed Jun 24, 2015 2:30 am, edited 1 time in total.
My Bitcoin address: 1NG9VKTZzA3patBrWySA4qRWcuKyYkhtfc
B
23
S
7
G
4
Posts: 320
Reputation: 3,839

Post » Sat Jun 20, 2015 1:43 pm

I don't know the particulars of your code but, I would use a global variable rather than an instance variable. It seems to me the instance variable is created after the start of the layout within the object. Setting the value with a global variable or even a local variable should resolve it.
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,273

Post » Sat Jun 20, 2015 10:33 pm

@TheDom I need remember the picked coins value and deleted instances, on Local Storage.
My Bitcoin address: 1NG9VKTZzA3patBrWySA4qRWcuKyYkhtfc
B
23
S
7
G
4
Posts: 320
Reputation: 3,839

Post » Sun Jun 21, 2015 6:36 am

im not sure where it is but somewhere on the forums someone made a capx and tutorial for what you need using the dictionary object to store the coin uid and at start of the layout you delete any uid listed if you search the forums for something like "dictionary" "coins" you should find it. sorry i cant be more help im on mobile and dont remember the events but i know it's here somewhere i used it in a prototype game
B
42
S
17
G
2
Posts: 850
Reputation: 6,209

Post » Sun Jun 21, 2015 2:48 pm

DaniellMesquita wrote:@TheDom I need remember the picked coins value and deleted instances, on Local Storage.


I understand. What I mean is to do a check on start up if there are values in local storage and then transfer the values from local storage to the global variables.


Also, check out this tutorial https://www.scirra.com/tutorials/1461/how-to-use-the-localstorage-plugin
Image
B
75
S
23
G
3
Posts: 673
Reputation: 9,273

Post » Mon Jun 22, 2015 10:28 pm

@volkiller730 where is this tutorial/topic? I can't find this.
My Bitcoin address: 1NG9VKTZzA3patBrWySA4qRWcuKyYkhtfc
B
23
S
7
G
4
Posts: 320
Reputation: 3,839

Post » Mon Jun 22, 2015 11:01 pm

DaniellMesquita wrote:@volkiller730 where is this tutorial/topic? I can't find this.


Doesn't clicking the link work for you?
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Tue Jun 23, 2015 6:30 pm

ImageImage
B
101
S
45
G
22
Posts: 772
Reputation: 21,468

Post » Tue Jun 23, 2015 10:23 pm

@alextro Thanks!
My Bitcoin address: 1NG9VKTZzA3patBrWySA4qRWcuKyYkhtfc
B
23
S
7
G
4
Posts: 320
Reputation: 3,839


Return to How do I....?

Who is online

Users browsing this forum: Lancifer, Yahoo [Bot] and 4 guests