Skip to content

Latest commit

 

History

History
126 lines (72 loc) · 2.97 KB

readme.md

File metadata and controls

126 lines (72 loc) · 2.97 KB

Documentation

Step 1 - Click the green download button to get the stencyl id.net extension.

Then install it and you'll see new code blocks.

Step 2 - You should have 3 different scenes.

  1. To load local saves (loadScene)
  2. For banned sites (lockedScene)
  3. To load online saves (mainMenu)

Duplicate the game attributes you want to save in cloud (use the prefix "cloud" - it's useful)

Step 3 - Scene: loadScene

Example code for loading local saves

First, we must initialize the app. After loading, set your game attributes with the prefix "cloud" as default. This is an important part. Also, create a game attribute NeedLoadingCloud.

Step 4 - Scene: mainMenu

Example code for loading id.net saves.

This code should be in for the update event. Before loading, you must save your non-cloud game attributes in local attributes (create local-blue attributes for it), and after loading use local-blue attributes to feed in their respective saved values. This is very important.

Use the following code for banned sites.

Step 5 - Example code for saving (id.net and local).

Step 6 - Example code for unlocking achievements.

To display the achievements menu.

Step 7 - Example code for submitting high scores

To show the high scores menu.

Step 8 - Example code for any menu button which might be covered by id.net UI

First, we must check if a id.net UI is open or not.

Step 9 - Example code for choosing save type (local or id.net)

Step 10 - LockedScene

A LockedScene can look something like this.

Add actor to the lockedScene.

Example code for this actor. This code lets the player highlight and copy/paste the correct game link in their browser.

//import:
import flash.text.TextField;
import flash.text.TextFormat;

//created:
var txt = new openfl.text.TextField();
		txt.width = 500;
		txt.height = 500;
		txt.x = 190;
		txt.y = 200;
		txt.wordWrap = true;
		txt.type = INPUT;
		txt.mouseEnabled = true;
		txt.selectable = true;
		txt.textColor = 0xffffff;
		txt.multiline = true;
		txt.wordWrap = true;
var lockText = "http://www.y8.com/games/game_name";
		txt.text = lockText;
		Engine.engine.root.parent.addChild(txt);
var formato:TextFormat = new TextFormat();
formato.size = 28;
formato.color=0xFF0033;
txt.setTextFormat(formato);

//updated:
txt.text = "http://www.y8.com/games/game_name";