Skip to content

Instantly share code, notes, and snippets.

import org.andengine.engine.options.EngineOptions;
import org.andengine.entity.scene.Scene;
import org.andengine.ui.activity.SimpleBaseGameActivity;
public class AndEngineTest extends SimpleBaseGameActivity {
@Override
public EngineOptions onCreateEngineOptions() {
// TODO Auto-generated method stub
return null;
@nipundavid
nipundavid / gist:5377894
Created April 13, 2013 10:36
main activity class
package com.example.zandlevelselector;
import org.andengine.engine.camera.Camera;
import org.andengine.engine.options.EngineOptions;
import org.andengine.engine.options.ScreenOrientation;
import org.andengine.engine.options.WakeLockOptions;
import org.andengine.engine.options.resolutionpolicy.FillResolutionPolicy;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.scene.background.Background;
import org.andengine.opengl.font.FontFactory;
@nipundavid
nipundavid / gist:5425331
Created April 20, 2013 09:08
First AndEngine project, that will display a blue color background in the scene
package com.example.anblog;
import org.andengine.engine.camera.Camera;
import org.andengine.engine.options.EngineOptions;
import org.andengine.engine.options.ScreenOrientation;
import org.andengine.engine.options.WakeLockOptions;
import org.andengine.engine.options.resolutionpolicy.FillResolutionPolicy;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.scene.background.Background;
import org.andengine.ui.activity.SimpleBaseGameActivity;
engineOptions = new EngineOptions(false,
ScreenOrientation.LANDSCAPE_FIXED, new FillResolutionPolicy(),
mCamera);
public EngineOptions(final boolean pFullscreen, final ScreenOrientation pScreenOrientation, final IResolutionPolicy
pResolutionPolicy, final Camera pCamera) {
this.mFullscreen = pFullscreen;
this.mScreenOrientation = pScreenOrientation;
this.mResolutionPolicy = pResolutionPolicy;
this.mCamera = pCamera;
}
protected Scene onCreateScene() {
mScene = new Scene();
mScene.setBackground(new Background(0.09804f, 0.6274f, 0.8784f));
return mScene;
}
package com.example.samplegame;
import org.andengine.engine.options.EngineOptions;
import android.content.Context;
public class ResourceManager {
// ResourceManager Singleton instance
private static ResourceManager INSTANCE;
package com.example.samplegame;
import org.andengine.engine.options.EngineOptions;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.atlas.bitmap.BuildableBitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.source.IBitmapTextureAtlasSource;
import org.andengine.opengl.texture.atlas.buildable.builder.BlackPawnTextureAtlasBuilder;
import org.andengine.opengl.texture.atlas.buildable.builder.ITextureAtlasBuilder.TextureAtlasBuilderException;
import org.andengine.opengl.texture.region.ITextureRegion;
public void twitter(int score) {
Share ("Very nice time killer game, created a highScore"+score,"","","","");
}
const string Address = "http://twitter.com/intent/tweet";
private void Share(string text, string url,
string related,string via, string hashtags, string lang="en")
{
@nipundavid
nipundavid / GooglePlayServices.cs
Last active April 13, 2016 08:08
Google Play Service SignIn script in Unity3d using Google Play services Unity plugin
/*
* GooglePlayServices.cs (c) by Nipun David
*
* GooglePlayServices.cs is licensed under a
* Creative Commons Attribution-ShareAlike 4.0 International License.
*
* You should have received a copy of the license along with this
* work. If not, see <http://creativecommons.org/licenses/by-sa/4.0/>.
*/