Saving Data

Discussion and feedback on Construct 2

Post » Fri Mar 07, 2014 11:02 pm

Hello,

I am trying to create an IOS (Eventually Android) App with construct and planning on Compiling it with cocoonJS.

Can I use the built in WebStorage Object to Save and retrieve data ? Will this still work after compiling with CocoonJS. Also what is the difference between running in 'Webview" and 'Canvas 2D/WEBGL' when using the CocoonJS launcher.

Sorry for these probably simple questions but I just starting to learn this software and the concepts.

Thanks
B
4
Posts: 16
Reputation: 232

Post » Mon Mar 10, 2014 9:33 pm

Has anyone saved any data using construct in a an ios game and can describe how to do it ?
B
4
Posts: 16
Reputation: 232

Post » Mon Mar 10, 2014 9:38 pm

snoopy123123 wrote:Has anyone saved any data using construct in a an ios game and can describe how to do it ?


Actually I'm making a game for iOS, and the webstorage is working when I try the game on wi-fi...my doubt is when you remove the cache from the iphone if the savegame still stay on the phone... but one user said to me is working when you publish the application... maybe the app will make a special folder with the cache of the app...

and how... you can see the manual of construct2: https://www.scirra.com/manual/120/webstorage
Last edited by Ribis on Mon Mar 10, 2014 9:40 pm, edited 1 time in total.
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Mon Mar 10, 2014 9:40 pm

How did you get the webstorage to work ? When I compile the game in html5 onto my webserver and run it using mobile safari on iphone 5 the webstorage is not working :-(
B
4
Posts: 16
Reputation: 232

Post » Mon Mar 10, 2014 9:52 pm

snoopy123123 wrote:How did you get the webstorage to work ? When I compile the game in html5 onto my webserver and run it using mobile safari on iphone 5 the webstorage is not working :-(


I never try to test my app on safari... the best way is to export in cocoonJS and make an application...

I made this example for you, try and let me know if is working
You do not have the required permissions to view the files attached to this post.
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Mon Mar 10, 2014 9:56 pm

Ok, that would be by next Question :-)

I have tried cocoon JS and I am just super confused as I am new to all this. I am a Developer but completely new to the game thing.

When opening Cocoon JS on Iphone it allows me to select a URL which I am pointing to my webserver and the game runs in full screen when I select webview mode. When I am trying to run using Canvas 2D /WEBGL I am getting a black screen. I do not really know what the difference here is.

How do you make an App and run it with CocoonJS ?

I will try your example know. Thank you for that.
B
4
Posts: 16
Reputation: 232

Post » Mon Mar 10, 2014 10:03 pm

snoopy123123 wrote:Ok, that would be by next Question :-)

I have tried cocoon JS and I am just super confused as I am new to all this. I am a Developer but completely new to the game thing.

When opening Cocoon JS on Iphone it allows me to select a URL which I am pointing to my webserver and the game runs in full screen when I select webview mode. When I am trying to run using Canvas 2D /WEBGL I am getting a black screen. I do not really know what the difference here is.

How do you make an App and run it with CocoonJS ?

I will try your example know. Thank you for that.


I'm not new to make game, but I'm new to export in cocoonJS :D ... when you finish your game, just upload on the website of ludei and register on apple developer... it's better if you get a premium account of cocoonJS...

when you click on canvas 2D/webGL, you need to wait some seconds (depends how is big the game) and check if your antivirus block the iphone when it try to open the game... you should look on the debug if you have some problem...

I had a problem with my firewall when I tried the application
B
21
S
9
Posts: 298
Reputation: 2,967

Post » Mon Mar 10, 2014 10:31 pm

Cool your example works fine, just implemented it into my game. I previously had something in there with if value exists which obviously didn't work right
B
4
Posts: 16
Reputation: 232

Post » Mon Mar 10, 2014 10:34 pm

Well, I guess I was to quick. it works fine on my PC's browser. On my iphone it's showing "NaN"

Any idea whats the reason behind that ?
B
4
Posts: 16
Reputation: 232

Post » Mon Mar 10, 2014 11:34 pm

snoopy123123 wrote:Well, I guess I was to quick. it works fine on my PC's browser. On my iphone it's showing "NaN"

Any idea whats the reason behind that ?


is "Nan" because on start layout I declare the variable with no value, if you click reset and try to add or sub the value will work fine ;)
B
21
S
9
Posts: 298
Reputation: 2,967

Next

Return to Construct 2 General

Who is online

Users browsing this forum: mihirolover and 3 guests