Skip to content

Instantly share code, notes, and snippets.

gamebuilderstudio

View GitHub Profile
@gamebuilderstudio
gamebuilderstudio / EmbeddedResources.as
Created Dec 3, 2014
A class to embed all external assets into a GBs game to make it self contained.
View EmbeddedResources.as
package
{
import com.pblabs.engine.resource.ResourceBundle;
public class EmbeddedResources extends ResourceBundle
{
[Embed(source="levels/GlobalsDescriptor.xml", mimeType="application/octet-stream")]
public var globalData : Class;
[Embed(source="levels/LevelsDescriptor.xml", mimeType="application/octet-stream")]
public var levelDescriptor : Class;
@gamebuilderstudio
gamebuilderstudio / NewGroundsAdLoaderStartupSequence.as
Created Feb 27, 2014
This is an example of manually overriding the default GameBuilder Studio startup sequence to us the NewGrounds API connector to show loading progress and an initial ad for your game. When the full api is officially supported by GameBuilder Studio this code will be auto generated for you by the editor.
View NewGroundsAdLoaderStartupSequence.as
package
{
import com.gbs.game.BaseGame;
import com.pblabs.engine.PBE;
import com.pblabs.engine.core.LevelEvent;
import flash.events.Event;
import com.newgrounds.API;
import com.newgrounds.APIEvent;
import com.newgrounds.components.APIConnector;
@gamebuilderstudio
gamebuilderstudio / OuyaCustomProductPurchase.as
Created Feb 13, 2014
This code can be implemented in the generated base project from GameBuilder Studio if you want to handle the Ouya product purchase logic yourself via code.
View OuyaCustomProductPurchase.as
package
{
import com.gaslightgames.nativeExtensions.AIROUYAFacadeANE.AIROUYAFacadeANE;
import com.gaslightgames.nativeExtensions.AIROUYAFacadeANE.AIROUYAFacadeANEEvent;
import com.gaslightgames.nativeExtensions.AIROUYAFacadeANE.Product;
import com.gbs.game.screens.BaseGameScreen;
import com.pblabs.engine.PBE;
import com.pblabs.engine.core.LevelEvent;
public class GameScreen extends BaseGameScreen
@gamebuilderstudio
gamebuilderstudio / PluginConfig_ExtensionSupport.xml
Last active Jan 2, 2016
Plugin Config W/ Native Extensions Support
View PluginConfig_ExtensionSupport.xml
<?xml version="1.0" encoding="UTF-8"?>
<pluginRoot version="v1">
<descriptor id="plugin::ouya" className="OuyaPluginDescriptor"/>
<extensions>
<extension>
<extensionID>com.gaslightgames.AIROUYAFacadeANE</extensionID>
<extlocation>ANEs/AIROUYAFacadeANE.ane</extlocation>
<!-- The currently available platform strings are: ANDROID, IOS -->
<platforms>
View CustomPluginDescriptor.as
package com.gbs.plugins.descriptor
{
import com.gbs.gameeditor.descriptors.ObjectDescriptor;
import com.gbs.plugins.CustomComponentClassList;
import com.gbs.plugins.DescriptorVO;
import com.gbs.plugins.PluginDescriptor;
import com.gbs.plugins.components.CustomGameEngineComponent;
import com.gbs.plugins.views.panels.CustomComponentPropertiesUI;
public final class CustomPluginDescriptor extends PluginDescriptor
View CustomComponentClassList.as
package com.gbs.plugins
{
import com.gbs.plugins.components.CustomGameEngineComponent;
import com.gbs.utils.ClassRegistrar;
import com.gbs.utils.ClassRegistrarTypes;
public class CustomComponentClassList
{
public function CustomComponentClassList(pluginUID : String = "_*_")
{
View CustomComponentPropertiesUI.mxml
<?xml version="1.0" encoding="utf-8"?>
<panels:BaseComponentPanelUISkin xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:panels="com.gbs.plugins.views.panels.*"
xmlns:components="com.gbs.gameeditor.common.views.components.*"
width="100%" height="100%">
<!-- host component -->
<fx:Metadata>
View BasicGameEngineComponent.as
package com.gbs.plugins.components
{
import com.pblabs.engine.entity.EntityComponent;
public final class CustomGameEngineComponent extends EntityComponent
{
public function CustomGameEngineComponent()
{
super();
}
View CustomGameEngineComponent.as
package com.gbs.plugins.components
{
import com.pblabs.engine.components.TickedComponent;
import com.pblabs.engine.entity.PropertyReference;
import flash.geom.Point;
public final class CustomGameEngineComponent extends TickedComponent
{
public var referencePositionOnSpatial : PropertyReference;
You can’t perform that action at this time.