├── .gitignore ├── build.gradle ├── core ├── assets │ ├── freetypefonts │ │ └── Berlin Sans FB.ttf │ ├── orig │ │ ├── pack.atlas │ │ ├── pack.png │ │ └── sprite_animations │ │ │ └── sheep │ │ │ ├── sheep.atlas │ │ │ └── sheep.png │ ├── project.dt │ └── scenes │ │ └── MainScene.dt ├── build.gradle └── src │ └── com │ └── uwsoft │ └── platformer │ ├── PlatformComponent.java │ ├── PlatformSystem.java │ ├── PlatformerTutorial.java │ ├── Player.java │ └── UIStage.java ├── desktop ├── build.gradle └── src │ └── com │ └── uwsoft │ └── platformer │ └── desktop │ └── DesktopLauncher.java ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── platformer_overlap2d_project ├── assets │ └── orig │ │ ├── freetypefonts │ │ └── Berlin Sans FB.ttf │ │ ├── images │ │ ├── ball.png │ │ ├── btn.9.png │ │ ├── btnPressed.9.png │ │ ├── paltform1.9.png │ │ ├── paltform2.png │ │ └── pillar.9.png │ │ ├── pack │ │ ├── pack.atlas │ │ └── pack.png │ │ └── sprite-animations │ │ └── sheep │ │ ├── sheep.atlas │ │ └── sheep.png ├── export │ ├── freetypefonts │ │ └── Berlin Sans FB.ttf │ ├── orig │ │ ├── pack.atlas │ │ ├── pack.png │ │ └── sprite_animations │ │ │ └── sheep │ │ │ ├── sheep.atlas │ │ │ └── sheep.png │ ├── project.dt │ └── scenes │ │ └── MainScene.dt ├── project.dt ├── project.pit └── scenes │ └── MainScene.dt └── settings.gradle /.gitignore: -------------------------------------------------------------------------------- 1 | ## Java 2 | 3 | *.class 4 | *.war 5 | *.ear 6 | hs_err_pid* 7 | 8 | ## GWT 9 | war/ 10 | html/war/gwt_bree/ 11 | html/gwt-unitCache/ 12 | .apt_generated/ 13 | html/war/WEB-INF/deploy/ 14 | html/war/WEB-INF/classes/ 15 | .gwt/ 16 | gwt-unitCache/ 17 | www-test/ 18 | .gwt-tmp/ 19 | 20 | ## Android Studio and Intellij and Android in general 21 | android/libs/armeabi/ 22 | android/libs/armeabi-v7a/ 23 | android/libs/x86/ 24 | android/gen/ 25 | .idea/ 26 | *.ipr 27 | *.iws 28 | *.iml 29 | out/ 30 | com_crashlytics_export_strings.xml 31 | 32 | ## Eclipse 33 | .classpath 34 | .project 35 | .metadata 36 | **/bin/ 37 | tmp/ 38 | *.tmp 39 | *.bak 40 | *.swp 41 | *~.nib 42 | local.properties 43 | .settings/ 44 | .loadpath 45 | .externalToolBuilders/ 46 | *.launch 47 | 48 | ## NetBeans 49 | **/nbproject/private/ 50 | build/ 51 | nbbuild/ 52 | dist/ 53 | nbdist/ 54 | nbactions.xml 55 | nb-configuration.xml 56 | 57 | ## Gradle 58 | 59 | .gradle 60 | gradle-app.setting 61 | build/ 62 | 63 | ## OS Specific 64 | .DS_Store 65 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenCentral() 4 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 5 | } 6 | dependencies { 7 | } 8 | } 9 | 10 | allprojects { 11 | apply plugin: "eclipse" 12 | apply plugin: "idea" 13 | 14 | version = '1.0' 15 | ext { 16 | appName = 'platformer-tutorial' 17 | gdxVersion = '1.6.4' 18 | roboVMVersion = '1.5.0' 19 | box2DLightsVersion = '1.4' 20 | ashleyVersion = '1.4.0' 21 | aiVersion = '1.5.0' 22 | } 23 | 24 | repositories { 25 | mavenCentral() 26 | maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } 27 | maven { url "https://oss.sonatype.org/content/repositories/releases/" } 28 | } 29 | } 30 | 31 | project(":desktop") { 32 | apply plugin: "java" 33 | 34 | 35 | dependencies { 36 | compile project(":core") 37 | compile "com.badlogicgames.gdx:gdx-backend-lwjgl:$gdxVersion" 38 | compile "com.badlogicgames.gdx:gdx-platform:$gdxVersion:natives-desktop" 39 | compile "com.badlogicgames.gdx:gdx-box2d-platform:$gdxVersion:natives-desktop" 40 | compile "com.badlogicgames.gdx:gdx-freetype-platform:$gdxVersion:natives-desktop" 41 | } 42 | } 43 | 44 | project(":core") { 45 | apply plugin: "java" 46 | 47 | 48 | dependencies { 49 | compile "com.badlogicgames.gdx:gdx:$gdxVersion" 50 | compile "com.badlogicgames.gdx:gdx-box2d:$gdxVersion" 51 | compile "com.underwaterapps.overlap2druntime:overlap2d-runtime-libgdx:0.1.1-SNAPSHOT" 52 | compile "com.badlogicgames.gdx:gdx-freetype:$gdxVersion" 53 | compile "com.badlogicgames.ashley:ashley:$ashleyVersion" 54 | compile "com.badlogicgames.box2dlights:box2dlights:$box2DLightsVersion" 55 | compile "com.badlogicgames.gdx:gdx-ai:$aiVersion" 56 | } 57 | } 58 | 59 | tasks.eclipse.doLast { 60 | delete ".project" 61 | } -------------------------------------------------------------------------------- /core/assets/freetypefonts/Berlin Sans FB.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/core/assets/freetypefonts/Berlin Sans FB.ttf -------------------------------------------------------------------------------- /core/assets/orig/pack.atlas: -------------------------------------------------------------------------------- 1 | 2 | pack.png 3 | size: 512,256 4 | format: RGBA8888 5 | filter: Linear,Linear 6 | repeat: none 7 | ball 8 | rotate: false 9 | xy: 329, 121 10 | size: 80, 80 11 | orig: 80, 80 12 | offset: 0, 0 13 | index: -1 14 | btn 15 | rotate: false 16 | xy: 2, 35 17 | size: 12, 52 18 | split: 4, 5, 6, 7 19 | orig: 12, 52 20 | offset: 0, 0 21 | index: -1 22 | btnPressed 23 | rotate: false 24 | xy: 329, 73 25 | size: 12, 46 26 | split: 4, 5, 4, 5 27 | orig: 12, 46 28 | offset: 0, 0 29 | index: -1 30 | paltform1 31 | rotate: false 32 | xy: 2, 121 33 | size: 230, 80 34 | split: 112, 109, 49, 28 35 | orig: 230, 80 36 | offset: 0, 0 37 | index: -1 38 | paltform2 39 | rotate: false 40 | xy: 2, 89 41 | size: 220, 30 42 | orig: 220, 30 43 | offset: 0, 0 44 | index: -1 45 | pillar 46 | rotate: false 47 | xy: 234, 2 48 | size: 93, 199 49 | split: 0, 93, 65, 51 50 | pad: -1, -1, 65, 50 51 | orig: 93, 199 52 | offset: 0, 0 53 | index: -1 54 | -------------------------------------------------------------------------------- /core/assets/orig/pack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/core/assets/orig/pack.png -------------------------------------------------------------------------------- /core/assets/orig/sprite_animations/sheep/sheep.atlas: -------------------------------------------------------------------------------- 1 | 2 | sheep.png 3 | size: 392,392 4 | format: RGBA8888 5 | filter: Nearest,Nearest 6 | repeat: none 7 | sheep0001 8 | rotate: false 9 | xy: 2, 296 10 | size: 124, 96 11 | orig: 124, 96 12 | offset: 0, 0 13 | index: -1 14 | sheep0002 15 | rotate: false 16 | xy: 2, 198 17 | size: 124, 96 18 | orig: 124, 96 19 | offset: 0, 0 20 | index: -1 21 | sheep0003 22 | rotate: false 23 | xy: 128, 296 24 | size: 124, 96 25 | orig: 124, 96 26 | offset: 0, 0 27 | index: -1 28 | sheep0004 29 | rotate: false 30 | xy: 2, 100 31 | size: 124, 96 32 | orig: 124, 96 33 | offset: 0, 0 34 | index: -1 35 | sheep0005 36 | rotate: false 37 | xy: 128, 198 38 | size: 124, 96 39 | orig: 124, 96 40 | offset: 0, 0 41 | index: -1 42 | sheep0006 43 | rotate: false 44 | xy: 254, 296 45 | size: 124, 96 46 | orig: 124, 96 47 | offset: 0, 0 48 | index: -1 49 | sheep0007 50 | rotate: false 51 | xy: 2, 2 52 | size: 124, 96 53 | orig: 124, 96 54 | offset: 0, 0 55 | index: -1 56 | -------------------------------------------------------------------------------- /core/assets/orig/sprite_animations/sheep/sheep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/core/assets/orig/sprite_animations/sheep/sheep.png -------------------------------------------------------------------------------- /core/assets/project.dt: -------------------------------------------------------------------------------- 1 | {"pixelToWorld":3,"originalResolution":{"name":"orig","width":1920,"height":1200},"scenes":[{"sceneName":"MainScene","physicsPropertiesVO":{}}],"libraryItems":{"menuButton":{"itemIdentifier":"button","tags":["button"],"x":229,"y":140.33334,"originX":0,"originY":0,"zIndex":1,"layerName":"Default","composite":{"sImage9patchs":[{"tags":[],"x":1.3333335,"y":0.33333325,"originX":2,"originY":8.666667,"layerName":"normal","imageName":"btn","width":45.106346,"height":18.40686},{"tags":[],"x":2.3333333,"y":0.8382262,"originX":2,"originY":7.6666665,"zIndex":1,"layerName":"pressed","imageName":"btnPressed","width":43.06713,"height":17.161774}],"sLabels":[{"tags":[],"x":3.666666,"y":1.3333336,"originX":20,"originY":8.333333,"zIndex":2,"layerName":"text","text":"Button","style":"Berlin Sans FB","size":40,"align":1,"width":40,"height":16.666666}],"layers":[{"layerName":"normal","isVisible":true},{"layerName":"pressed","isVisible":true},{"layerName":"text","isVisible":true}]},"width":46.43968,"height":18.740194}}} -------------------------------------------------------------------------------- /core/assets/scenes/MainScene.dt: -------------------------------------------------------------------------------- 1 | {"sceneName":"MainScene","composite":{"sImages":[{"uniqueId":9,"tags":[],"x":182.66667,"y":35.666668,"originX":0,"originY":0,"zIndex":1,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":5,"tags":[],"x":416.33334,"y":119.333336,"originX":0,"originY":0,"zIndex":2,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":4,"tags":[],"x":343.00003,"y":89.666664,"originX":0,"originY":0,"zIndex":3,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":3,"tags":["platform"],"x":263.33334,"y":65,"originX":0,"originY":0,"zIndex":4,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":6,"tags":["platform"],"x":546.6667,"y":90,"originX":0,"originY":0,"zIndex":5,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":15,"tags":[],"x":498.6667,"y":150.66666,"originX":0,"originY":0,"zIndex":7,"layerName":"Default","imageName":"ball"}],"sImage9patchs":[{"uniqueId":8,"tags":[],"x":-349.66666,"y":-17.333334,"originX":38.333336,"originY":13.333334,"layerName":"Default","shape":{"polygons":[[{},{"y":26.666668},{"x":1368.9999,"y":26.666668},{"x":1368.9999}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform1","width":1368.9999,"height":26.666668},{"uniqueId":13,"tags":[],"x":496,"y":9.000002,"originX":15.5,"originY":33.166668,"zIndex":6,"layerName":"Default","imageName":"pillar","width":31,"height":135.66667},{"uniqueId":2,"tags":[],"x":1.6666679,"y":8.666666,"originX":15.5,"originY":33.166668,"zIndex":9,"layerName":"Default","imageName":"pillar","width":31,"height":66.333336}],"sSpriteAnimations":[{"uniqueId":18,"itemIdentifier":"player","tags":[],"x":92,"y":39.333336,"originX":20.666666,"originY":16,"zIndex":8,"layerName":"Default","animationName":"sheep","currentAnimation":"Default","frameRangeMap":[{"name":"Default","endFrame":6}],"playMode":2}],"layers":[{"layerName":"Default","isVisible":true}]},"physicsPropertiesVO":{},"verticalGuides":[266.6667,0.20433554],"horizontalGuides":[160,0.13879395]} -------------------------------------------------------------------------------- /core/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | 3 | sourceCompatibility = 1.6 4 | [compileJava, compileTestJava]*.options*.encoding = 'UTF-8' 5 | 6 | sourceSets.main.java.srcDirs = [ "src/" ] 7 | 8 | 9 | eclipse.project { 10 | name = appName + "-core" 11 | } 12 | -------------------------------------------------------------------------------- /core/src/com/uwsoft/platformer/PlatformComponent.java: -------------------------------------------------------------------------------- 1 | package com.uwsoft.platformer; 2 | 3 | import com.badlogic.ashley.core.Component; 4 | import com.badlogic.gdx.math.Vector2; 5 | 6 | /** 7 | * Created by CyberJoe on 8/9/2015. 8 | */ 9 | public class PlatformComponent extends Component { 10 | Vector2 originalPosition; 11 | float timePassed = 0; 12 | } 13 | -------------------------------------------------------------------------------- /core/src/com/uwsoft/platformer/PlatformSystem.java: -------------------------------------------------------------------------------- 1 | package com.uwsoft.platformer; 2 | 3 | import com.badlogic.ashley.core.ComponentMapper; 4 | import com.badlogic.ashley.core.Entity; 5 | import com.badlogic.ashley.core.Family; 6 | import com.badlogic.ashley.systems.IteratingSystem; 7 | import com.badlogic.gdx.math.MathUtils; 8 | import com.badlogic.gdx.math.Vector2; 9 | import com.uwsoft.editor.renderer.components.TransformComponent; 10 | import com.uwsoft.editor.renderer.components.physics.PhysicsBodyComponent; 11 | import com.uwsoft.editor.renderer.physics.PhysicsBodyLoader; 12 | import com.uwsoft.editor.renderer.utils.ComponentRetriever; 13 | 14 | /** 15 | * Created by azakhary on 8/9/2015. 16 | */ 17 | public class PlatformSystem extends IteratingSystem { 18 | 19 | private ComponentMapper platformComponentComponentMapper = ComponentMapper.getFor(PlatformComponent.class); 20 | 21 | public PlatformSystem() { 22 | super(Family.all(PlatformComponent.class).get()); 23 | } 24 | 25 | @Override 26 | protected void processEntity(Entity entity, float deltaTime) { 27 | PlatformComponent platformComponent = platformComponentComponentMapper.get(entity); 28 | TransformComponent transformComponent = ComponentRetriever.get(entity, TransformComponent.class); 29 | PhysicsBodyComponent physicsBodyComponent = ComponentRetriever.get(entity, PhysicsBodyComponent.class); 30 | 31 | if(platformComponent.originalPosition == null) { 32 | platformComponent.originalPosition = new Vector2(transformComponent.x, transformComponent.y); 33 | platformComponent.timePassed = MathUtils.random(0, 2000); 34 | } 35 | 36 | platformComponent.timePassed+=deltaTime; 37 | 38 | Vector2 newPosition = new Vector2(); 39 | newPosition.x = physicsBodyComponent.body.getPosition().x; 40 | newPosition.y = (platformComponent.originalPosition.y + MathUtils.cos(platformComponent.timePassed*MathUtils.degreesToRadians*40f) * 20f) * PhysicsBodyLoader.getScale(); 41 | 42 | physicsBodyComponent.body.setTransform(newPosition, physicsBodyComponent.body.getAngle()); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /core/src/com/uwsoft/platformer/PlatformerTutorial.java: -------------------------------------------------------------------------------- 1 | package com.uwsoft.platformer; 2 | 3 | import com.badlogic.gdx.ApplicationAdapter; 4 | import com.badlogic.gdx.Gdx; 5 | import com.badlogic.gdx.graphics.GL20; 6 | import com.badlogic.gdx.graphics.OrthographicCamera; 7 | import com.badlogic.gdx.utils.viewport.FitViewport; 8 | import com.badlogic.gdx.utils.viewport.Viewport; 9 | import com.uwsoft.editor.renderer.SceneLoader; 10 | import com.uwsoft.editor.renderer.utils.ItemWrapper; 11 | 12 | public class PlatformerTutorial extends ApplicationAdapter { 13 | 14 | private SceneLoader sceneLoader; 15 | private Viewport viewport; 16 | private Player player; 17 | 18 | private UIStage uiStage; 19 | 20 | @Override 21 | public void create () { 22 | viewport = new FitViewport(266, 160); 23 | sceneLoader = new SceneLoader(); 24 | sceneLoader.loadScene("MainScene", viewport); 25 | 26 | ItemWrapper root = new ItemWrapper(sceneLoader.getRoot()); 27 | 28 | player = new Player(sceneLoader.world); 29 | root.getChild("player").addScript(player); 30 | 31 | uiStage = new UIStage(sceneLoader.getRm()); 32 | 33 | sceneLoader.addComponentsByTagName("platform", PlatformComponent.class); 34 | 35 | sceneLoader.getEngine().addSystem(new PlatformSystem()); 36 | } 37 | 38 | @Override 39 | public void render () { 40 | Gdx.gl.glClearColor(0.5f, 0.5f, 0.5f, 1); 41 | Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); 42 | 43 | sceneLoader.getEngine().update(Gdx.graphics.getDeltaTime()); 44 | 45 | uiStage.act(); 46 | uiStage.draw(); 47 | 48 | ((OrthographicCamera)viewport.getCamera()).position.x = player.getX()+player.getWidth()/2f; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /core/src/com/uwsoft/platformer/Player.java: -------------------------------------------------------------------------------- 1 | package com.uwsoft.platformer; 2 | 3 | import com.badlogic.ashley.core.Entity; 4 | import com.badlogic.gdx.Gdx; 5 | import com.badlogic.gdx.Input; 6 | import com.badlogic.gdx.math.Vector2; 7 | import com.badlogic.gdx.physics.box2d.Fixture; 8 | import com.badlogic.gdx.physics.box2d.RayCastCallback; 9 | import com.badlogic.gdx.physics.box2d.World; 10 | import com.uwsoft.editor.renderer.components.DimensionsComponent; 11 | import com.uwsoft.editor.renderer.components.TransformComponent; 12 | import com.uwsoft.editor.renderer.physics.PhysicsBodyLoader; 13 | import com.uwsoft.editor.renderer.scripts.IScript; 14 | import com.uwsoft.editor.renderer.utils.ComponentRetriever; 15 | 16 | /** 17 | * Created by azakhary on 8/4/2015. 18 | */ 19 | public class Player implements IScript { 20 | 21 | private Entity player; 22 | private TransformComponent transformComponent; 23 | private DimensionsComponent dimensionsComponent; 24 | 25 | private World world; 26 | 27 | private Vector2 speed; 28 | private float gravity = -500f; 29 | 30 | private final float jumpSpeed = 200f; 31 | 32 | public Player(World world) { 33 | this.world = world; 34 | } 35 | 36 | 37 | @Override 38 | public void init(Entity entity) { 39 | player = entity; 40 | 41 | transformComponent = ComponentRetriever.get(entity, TransformComponent.class); 42 | dimensionsComponent = ComponentRetriever.get(entity, DimensionsComponent.class); 43 | 44 | speed = new Vector2(100, 0); 45 | } 46 | 47 | @Override 48 | public void act(float delta) { 49 | 50 | if(Gdx.input.isKeyPressed(Input.Keys.LEFT)) { 51 | transformComponent.x-=speed.x*delta; 52 | transformComponent.scaleX = -1f; 53 | } 54 | 55 | if(Gdx.input.isKeyPressed(Input.Keys.RIGHT)) { 56 | transformComponent.x+=speed.x*delta; 57 | transformComponent.scaleX = 1f; 58 | } 59 | 60 | if(Gdx.input.isKeyJustPressed(Input.Keys.SPACE)) { 61 | speed.y = jumpSpeed; 62 | } 63 | 64 | speed.y+=gravity*delta; 65 | 66 | transformComponent.y += speed.y*delta; 67 | 68 | rayCast(); 69 | } 70 | 71 | private void rayCast() { 72 | float rayGap = dimensionsComponent.height/2; 73 | 74 | // Ray size is the exact size of the deltaY change we plan for this frame 75 | float raySize = -(speed.y)*Gdx.graphics.getDeltaTime(); 76 | 77 | //if(raySize < 5f) raySize = 5f; 78 | 79 | // only check for collisions when moving down 80 | if(speed.y > 0) return; 81 | 82 | // Vectors of ray from middle middle 83 | Vector2 rayFrom = new Vector2((transformComponent.x+dimensionsComponent.width/2)*PhysicsBodyLoader.getScale(), (transformComponent.y+rayGap)* PhysicsBodyLoader.getScale()); 84 | Vector2 rayTo = new Vector2((transformComponent.x+dimensionsComponent.width/2)*PhysicsBodyLoader.getScale(), (transformComponent.y - raySize)*PhysicsBodyLoader.getScale()); 85 | 86 | // Cast the ray 87 | world.rayCast(new RayCastCallback() { 88 | @Override 89 | public float reportRayFixture(Fixture fixture, Vector2 point, Vector2 normal, float fraction) { 90 | // Stop the player 91 | speed.y = 0; 92 | 93 | // reposition player slightly upper the collision point 94 | transformComponent.y = point.y / PhysicsBodyLoader.getScale() + 0.01f; 95 | 96 | return 0; 97 | } 98 | }, rayFrom, rayTo); 99 | } 100 | 101 | public float getX() { 102 | return transformComponent.x; 103 | } 104 | 105 | public float getY() { 106 | return transformComponent.y; 107 | } 108 | 109 | @Override 110 | public void dispose() { 111 | 112 | } 113 | 114 | public float getWidth() { 115 | return dimensionsComponent.width; 116 | } 117 | } 118 | -------------------------------------------------------------------------------- /core/src/com/uwsoft/platformer/UIStage.java: -------------------------------------------------------------------------------- 1 | package com.uwsoft.platformer; 2 | 3 | import com.badlogic.gdx.Gdx; 4 | import com.badlogic.gdx.scenes.scene2d.Actor; 5 | import com.badlogic.gdx.scenes.scene2d.InputEvent; 6 | import com.badlogic.gdx.scenes.scene2d.Stage; 7 | import com.badlogic.gdx.scenes.scene2d.utils.ChangeListener; 8 | import com.badlogic.gdx.scenes.scene2d.utils.ClickListener; 9 | import com.uwsoft.editor.renderer.data.CompositeItemVO; 10 | import com.uwsoft.editor.renderer.data.ProjectInfoVO; 11 | import com.uwsoft.editor.renderer.resources.IResourceRetriever; 12 | import com.uwsoft.editor.renderer.scene2d.CompositeActor; 13 | 14 | /** 15 | * Created by azakhary on 8/5/2015. 16 | */ 17 | public class UIStage extends Stage { 18 | 19 | public UIStage(IResourceRetriever ir) { 20 | 21 | Gdx.input.setInputProcessor(this); 22 | 23 | ProjectInfoVO projectInfo = ir.getProjectVO(); 24 | 25 | CompositeItemVO menuButtonData = projectInfo.libraryItems.get("menuButton"); 26 | CompositeActor buttonActor = new CompositeActor(menuButtonData, ir); 27 | 28 | addActor(buttonActor); 29 | 30 | buttonActor.setX(getWidth() - buttonActor.getWidth()); 31 | buttonActor.setY(getHeight() - buttonActor.getHeight()); 32 | 33 | buttonActor.addListener(new ClickListener() { 34 | @Override 35 | public void clicked (InputEvent event, float x, float y) { 36 | System.out.println("Hi"); 37 | } 38 | }); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /desktop/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: "java" 2 | 3 | sourceCompatibility = 1.6 4 | sourceSets.main.java.srcDirs = [ "src/" ] 5 | 6 | project.ext.mainClassName = "com.uwsoft.platformer.desktop.DesktopLauncher" 7 | project.ext.assetsDir = new File("../core/assets"); 8 | 9 | task run(dependsOn: classes, type: JavaExec) { 10 | main = project.mainClassName 11 | classpath = sourceSets.main.runtimeClasspath 12 | standardInput = System.in 13 | workingDir = project.assetsDir 14 | ignoreExitValue = true 15 | } 16 | 17 | task dist(type: Jar) { 18 | from files(sourceSets.main.output.classesDir) 19 | from files(sourceSets.main.output.resourcesDir) 20 | from {configurations.compile.collect {zipTree(it)}} 21 | from files(project.assetsDir); 22 | 23 | manifest { 24 | attributes 'Main-Class': project.mainClassName 25 | } 26 | } 27 | 28 | dist.dependsOn classes 29 | 30 | eclipse { 31 | project { 32 | name = appName + "-desktop" 33 | linkedResource name: 'assets', type: '2', location: 'PARENT-1-PROJECT_LOC/core/assets' 34 | } 35 | } 36 | 37 | task afterEclipseImport(description: "Post processing after project generation", group: "IDE") { 38 | doLast { 39 | def classpath = new XmlParser().parse(file(".classpath")) 40 | new Node(classpath, "classpathentry", [ kind: 'src', path: 'assets' ]); 41 | def writer = new FileWriter(file(".classpath")) 42 | def printer = new XmlNodePrinter(new PrintWriter(writer)) 43 | printer.setPreserveWhitespace(true) 44 | printer.print(classpath) 45 | } 46 | } -------------------------------------------------------------------------------- /desktop/src/com/uwsoft/platformer/desktop/DesktopLauncher.java: -------------------------------------------------------------------------------- 1 | package com.uwsoft.platformer.desktop; 2 | 3 | import com.badlogic.gdx.backends.lwjgl.LwjglApplication; 4 | import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; 5 | import com.uwsoft.platformer.PlatformerTutorial; 6 | 7 | public class DesktopLauncher { 8 | public static void main (String[] arg) { 9 | LwjglApplicationConfiguration config = new LwjglApplicationConfiguration(); 10 | config.width = 800; 11 | config.height = 480; 12 | new LwjglApplication(new PlatformerTutorial(), config); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.daemon=true 2 | org.gradle.jvmargs=-Xms128m -Xmx512m 3 | org.gradle.configureondemand=true -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Sat Sep 21 13:08:26 CEST 2013 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=http\://services.gradle.org/distributions/gradle-2.4-all.zip 7 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 10 | DEFAULT_JVM_OPTS="" 11 | 12 | APP_NAME="Gradle" 13 | APP_BASE_NAME=`basename "$0"` 14 | 15 | # Use the maximum available, or set MAX_FD != -1 to use that value. 16 | MAX_FD="maximum" 17 | 18 | warn ( ) { 19 | echo "$*" 20 | } 21 | 22 | die ( ) { 23 | echo 24 | echo "$*" 25 | echo 26 | exit 1 27 | } 28 | 29 | # OS specific support (must be 'true' or 'false'). 30 | cygwin=false 31 | msys=false 32 | darwin=false 33 | case "`uname`" in 34 | CYGWIN* ) 35 | cygwin=true 36 | ;; 37 | Darwin* ) 38 | darwin=true 39 | ;; 40 | MINGW* ) 41 | msys=true 42 | ;; 43 | esac 44 | 45 | # For Cygwin, ensure paths are in UNIX format before anything is touched. 46 | if $cygwin ; then 47 | [ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"` 48 | fi 49 | 50 | # Attempt to set APP_HOME 51 | # Resolve links: $0 may be a link 52 | PRG="$0" 53 | # Need this for relative symlinks. 54 | while [ -h "$PRG" ] ; do 55 | ls=`ls -ld "$PRG"` 56 | link=`expr "$ls" : '.*-> \(.*\)$'` 57 | if expr "$link" : '/.*' > /dev/null; then 58 | PRG="$link" 59 | else 60 | PRG=`dirname "$PRG"`"/$link" 61 | fi 62 | done 63 | SAVED="`pwd`" 64 | cd "`dirname \"$PRG\"`/" >&- 65 | APP_HOME="`pwd -P`" 66 | cd "$SAVED" >&- 67 | 68 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 69 | 70 | # Determine the Java command to use to start the JVM. 71 | if [ -n "$JAVA_HOME" ] ; then 72 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 73 | # IBM's JDK on AIX uses strange locations for the executables 74 | JAVACMD="$JAVA_HOME/jre/sh/java" 75 | else 76 | JAVACMD="$JAVA_HOME/bin/java" 77 | fi 78 | if [ ! -x "$JAVACMD" ] ; then 79 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 80 | 81 | Please set the JAVA_HOME variable in your environment to match the 82 | location of your Java installation." 83 | fi 84 | else 85 | JAVACMD="java" 86 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 87 | 88 | Please set the JAVA_HOME variable in your environment to match the 89 | location of your Java installation." 90 | fi 91 | 92 | # Increase the maximum file descriptors if we can. 93 | if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then 94 | MAX_FD_LIMIT=`ulimit -H -n` 95 | if [ $? -eq 0 ] ; then 96 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 97 | MAX_FD="$MAX_FD_LIMIT" 98 | fi 99 | ulimit -n $MAX_FD 100 | if [ $? -ne 0 ] ; then 101 | warn "Could not set maximum file descriptor limit: $MAX_FD" 102 | fi 103 | else 104 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 105 | fi 106 | fi 107 | 108 | # For Darwin, add options to specify how the application appears in the dock 109 | if $darwin; then 110 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 111 | fi 112 | 113 | # For Cygwin, switch paths to Windows format before running java 114 | if $cygwin ; then 115 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 116 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules 158 | function splitJvmOpts() { 159 | JVM_OPTS=("$@") 160 | } 161 | eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS 162 | JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME" 163 | 164 | exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@" 165 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 12 | set DEFAULT_JVM_OPTS= 13 | 14 | set DIRNAME=%~dp0 15 | if "%DIRNAME%" == "" set DIRNAME=. 16 | set APP_BASE_NAME=%~n0 17 | set APP_HOME=%DIRNAME% 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windowz variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | if "%@eval[2+2]" == "4" goto 4NT_args 53 | 54 | :win9xME_args 55 | @rem Slurp the command line arguments. 56 | set CMD_LINE_ARGS= 57 | set _SKIP=2 58 | 59 | :win9xME_args_slurp 60 | if "x%~1" == "x" goto execute 61 | 62 | set CMD_LINE_ARGS=%* 63 | goto execute 64 | 65 | :4NT_args 66 | @rem Get arguments from the 4NT Shell from JP Software 67 | set CMD_LINE_ARGS=%$ 68 | 69 | :execute 70 | @rem Setup the command line 71 | 72 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 73 | 74 | @rem Execute Gradle 75 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 76 | 77 | :end 78 | @rem End local scope for the variables with windows NT shell 79 | if "%ERRORLEVEL%"=="0" goto mainEnd 80 | 81 | :fail 82 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 83 | rem the _cmd.exe /c_ return code! 84 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 85 | exit /b 1 86 | 87 | :mainEnd 88 | if "%OS%"=="Windows_NT" endlocal 89 | 90 | :omega 91 | -------------------------------------------------------------------------------- /platformer_overlap2d_project/assets/orig/freetypefonts/Berlin Sans FB.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/assets/orig/freetypefonts/Berlin Sans FB.ttf -------------------------------------------------------------------------------- /platformer_overlap2d_project/assets/orig/images/ball.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/assets/orig/images/ball.png -------------------------------------------------------------------------------- /platformer_overlap2d_project/assets/orig/images/btn.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/assets/orig/images/btn.9.png -------------------------------------------------------------------------------- /platformer_overlap2d_project/assets/orig/images/btnPressed.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/assets/orig/images/btnPressed.9.png -------------------------------------------------------------------------------- /platformer_overlap2d_project/assets/orig/images/paltform1.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/assets/orig/images/paltform1.9.png -------------------------------------------------------------------------------- /platformer_overlap2d_project/assets/orig/images/paltform2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/assets/orig/images/paltform2.png -------------------------------------------------------------------------------- /platformer_overlap2d_project/assets/orig/images/pillar.9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/assets/orig/images/pillar.9.png -------------------------------------------------------------------------------- /platformer_overlap2d_project/assets/orig/pack/pack.atlas: -------------------------------------------------------------------------------- 1 | 2 | pack.png 3 | size: 512,256 4 | format: RGBA8888 5 | filter: Linear,Linear 6 | repeat: none 7 | ball 8 | rotate: false 9 | xy: 329, 121 10 | size: 80, 80 11 | orig: 80, 80 12 | offset: 0, 0 13 | index: -1 14 | btn 15 | rotate: false 16 | xy: 2, 35 17 | size: 12, 52 18 | split: 4, 5, 6, 7 19 | orig: 12, 52 20 | offset: 0, 0 21 | index: -1 22 | btnPressed 23 | rotate: false 24 | xy: 329, 73 25 | size: 12, 46 26 | split: 4, 5, 4, 5 27 | orig: 12, 46 28 | offset: 0, 0 29 | index: -1 30 | paltform1 31 | rotate: false 32 | xy: 2, 121 33 | size: 230, 80 34 | split: 112, 109, 49, 28 35 | orig: 230, 80 36 | offset: 0, 0 37 | index: -1 38 | paltform2 39 | rotate: false 40 | xy: 2, 89 41 | size: 220, 30 42 | orig: 220, 30 43 | offset: 0, 0 44 | index: -1 45 | pillar 46 | rotate: false 47 | xy: 234, 2 48 | size: 93, 199 49 | split: 0, 93, 65, 51 50 | pad: -1, -1, 65, 50 51 | orig: 93, 199 52 | offset: 0, 0 53 | index: -1 54 | -------------------------------------------------------------------------------- /platformer_overlap2d_project/assets/orig/pack/pack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/assets/orig/pack/pack.png -------------------------------------------------------------------------------- /platformer_overlap2d_project/assets/orig/sprite-animations/sheep/sheep.atlas: -------------------------------------------------------------------------------- 1 | 2 | sheep.png 3 | size: 392,392 4 | format: RGBA8888 5 | filter: Nearest,Nearest 6 | repeat: none 7 | sheep0001 8 | rotate: false 9 | xy: 2, 296 10 | size: 124, 96 11 | orig: 124, 96 12 | offset: 0, 0 13 | index: -1 14 | sheep0002 15 | rotate: false 16 | xy: 2, 198 17 | size: 124, 96 18 | orig: 124, 96 19 | offset: 0, 0 20 | index: -1 21 | sheep0003 22 | rotate: false 23 | xy: 128, 296 24 | size: 124, 96 25 | orig: 124, 96 26 | offset: 0, 0 27 | index: -1 28 | sheep0004 29 | rotate: false 30 | xy: 2, 100 31 | size: 124, 96 32 | orig: 124, 96 33 | offset: 0, 0 34 | index: -1 35 | sheep0005 36 | rotate: false 37 | xy: 128, 198 38 | size: 124, 96 39 | orig: 124, 96 40 | offset: 0, 0 41 | index: -1 42 | sheep0006 43 | rotate: false 44 | xy: 254, 296 45 | size: 124, 96 46 | orig: 124, 96 47 | offset: 0, 0 48 | index: -1 49 | sheep0007 50 | rotate: false 51 | xy: 2, 2 52 | size: 124, 96 53 | orig: 124, 96 54 | offset: 0, 0 55 | index: -1 56 | -------------------------------------------------------------------------------- /platformer_overlap2d_project/assets/orig/sprite-animations/sheep/sheep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/assets/orig/sprite-animations/sheep/sheep.png -------------------------------------------------------------------------------- /platformer_overlap2d_project/export/freetypefonts/Berlin Sans FB.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/export/freetypefonts/Berlin Sans FB.ttf -------------------------------------------------------------------------------- /platformer_overlap2d_project/export/orig/pack.atlas: -------------------------------------------------------------------------------- 1 | 2 | pack.png 3 | size: 512,256 4 | format: RGBA8888 5 | filter: Linear,Linear 6 | repeat: none 7 | ball 8 | rotate: false 9 | xy: 329, 121 10 | size: 80, 80 11 | orig: 80, 80 12 | offset: 0, 0 13 | index: -1 14 | btn 15 | rotate: false 16 | xy: 2, 35 17 | size: 12, 52 18 | split: 4, 5, 6, 7 19 | orig: 12, 52 20 | offset: 0, 0 21 | index: -1 22 | btnPressed 23 | rotate: false 24 | xy: 329, 73 25 | size: 12, 46 26 | split: 4, 5, 4, 5 27 | orig: 12, 46 28 | offset: 0, 0 29 | index: -1 30 | paltform1 31 | rotate: false 32 | xy: 2, 121 33 | size: 230, 80 34 | split: 112, 109, 49, 28 35 | orig: 230, 80 36 | offset: 0, 0 37 | index: -1 38 | paltform2 39 | rotate: false 40 | xy: 2, 89 41 | size: 220, 30 42 | orig: 220, 30 43 | offset: 0, 0 44 | index: -1 45 | pillar 46 | rotate: false 47 | xy: 234, 2 48 | size: 93, 199 49 | split: 0, 93, 65, 51 50 | pad: -1, -1, 65, 50 51 | orig: 93, 199 52 | offset: 0, 0 53 | index: -1 54 | -------------------------------------------------------------------------------- /platformer_overlap2d_project/export/orig/pack.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/export/orig/pack.png -------------------------------------------------------------------------------- /platformer_overlap2d_project/export/orig/sprite_animations/sheep/sheep.atlas: -------------------------------------------------------------------------------- 1 | 2 | sheep.png 3 | size: 392,392 4 | format: RGBA8888 5 | filter: Nearest,Nearest 6 | repeat: none 7 | sheep0001 8 | rotate: false 9 | xy: 2, 296 10 | size: 124, 96 11 | orig: 124, 96 12 | offset: 0, 0 13 | index: -1 14 | sheep0002 15 | rotate: false 16 | xy: 2, 198 17 | size: 124, 96 18 | orig: 124, 96 19 | offset: 0, 0 20 | index: -1 21 | sheep0003 22 | rotate: false 23 | xy: 128, 296 24 | size: 124, 96 25 | orig: 124, 96 26 | offset: 0, 0 27 | index: -1 28 | sheep0004 29 | rotate: false 30 | xy: 2, 100 31 | size: 124, 96 32 | orig: 124, 96 33 | offset: 0, 0 34 | index: -1 35 | sheep0005 36 | rotate: false 37 | xy: 128, 198 38 | size: 124, 96 39 | orig: 124, 96 40 | offset: 0, 0 41 | index: -1 42 | sheep0006 43 | rotate: false 44 | xy: 254, 296 45 | size: 124, 96 46 | orig: 124, 96 47 | offset: 0, 0 48 | index: -1 49 | sheep0007 50 | rotate: false 51 | xy: 2, 2 52 | size: 124, 96 53 | orig: 124, 96 54 | offset: 0, 0 55 | index: -1 56 | -------------------------------------------------------------------------------- /platformer_overlap2d_project/export/orig/sprite_animations/sheep/sheep.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/azakhary/platformer_tutorial/92c7a30ba0bb7f3e7ad5993f1e4a17a80e20e67e/platformer_overlap2d_project/export/orig/sprite_animations/sheep/sheep.png -------------------------------------------------------------------------------- /platformer_overlap2d_project/export/project.dt: -------------------------------------------------------------------------------- 1 | {"pixelToWorld":3,"originalResolution":{"name":"orig","width":1920,"height":1200},"scenes":[{"sceneName":"MainScene","physicsPropertiesVO":{}}],"libraryItems":{"menuButton":{"itemIdentifier":"button","tags":["button"],"x":229,"y":140.33334,"originX":0,"originY":0,"zIndex":1,"layerName":"Default","composite":{"sImage9patchs":[{"tags":[],"x":1.3333335,"y":0.33333325,"originX":2,"originY":8.666667,"layerName":"normal","imageName":"btn","width":45.106346,"height":18.40686},{"tags":[],"x":2.3333333,"y":0.8382262,"originX":2,"originY":7.6666665,"zIndex":1,"layerName":"pressed","imageName":"btnPressed","width":43.06713,"height":17.161774}],"sLabels":[{"tags":[],"x":3.666666,"y":1.3333336,"originX":20,"originY":8.333333,"zIndex":2,"layerName":"text","text":"Button","style":"Berlin Sans FB","size":40,"align":1,"width":40,"height":16.666666}],"layers":[{"layerName":"normal","isVisible":true},{"layerName":"pressed","isVisible":true},{"layerName":"text","isVisible":true}]},"width":46.43968,"height":18.740194}}} -------------------------------------------------------------------------------- /platformer_overlap2d_project/export/scenes/MainScene.dt: -------------------------------------------------------------------------------- 1 | {"sceneName":"MainScene","composite":{"sImages":[{"uniqueId":9,"tags":[],"x":182.66667,"y":35.666668,"originX":0,"originY":0,"zIndex":1,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":5,"tags":[],"x":416.33334,"y":119.333336,"originX":0,"originY":0,"zIndex":2,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":4,"tags":[],"x":343.00003,"y":89.666664,"originX":0,"originY":0,"zIndex":3,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":3,"tags":["platform"],"x":263.33334,"y":65,"originX":0,"originY":0,"zIndex":4,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":6,"tags":["platform"],"x":546.6667,"y":90,"originX":0,"originY":0,"zIndex":5,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":15,"tags":[],"x":498.6667,"y":150.66666,"originX":0,"originY":0,"zIndex":7,"layerName":"Default","imageName":"ball"}],"sImage9patchs":[{"uniqueId":8,"tags":[],"x":-349.66666,"y":-17.333334,"originX":38.333336,"originY":13.333334,"layerName":"Default","shape":{"polygons":[[{},{"y":26.666668},{"x":1368.9999,"y":26.666668},{"x":1368.9999}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform1","width":1368.9999,"height":26.666668},{"uniqueId":13,"tags":[],"x":496,"y":9.000002,"originX":15.5,"originY":33.166668,"zIndex":6,"layerName":"Default","imageName":"pillar","width":31,"height":135.66667},{"uniqueId":2,"tags":[],"x":1.6666679,"y":8.666666,"originX":15.5,"originY":33.166668,"zIndex":9,"layerName":"Default","imageName":"pillar","width":31,"height":66.333336}],"sSpriteAnimations":[{"uniqueId":18,"itemIdentifier":"player","tags":[],"x":92,"y":39.333336,"originX":20.666666,"originY":16,"zIndex":8,"layerName":"Default","animationName":"sheep","currentAnimation":"Default","frameRangeMap":[{"name":"Default","endFrame":6}],"playMode":2}],"layers":[{"layerName":"Default","isVisible":true}]},"physicsPropertiesVO":{},"verticalGuides":[266.6667,0.20433554],"horizontalGuides":[160,0.13879395]} -------------------------------------------------------------------------------- /platformer_overlap2d_project/project.dt: -------------------------------------------------------------------------------- 1 | {"pixelToWorld":3,"originalResolution":{"name":"orig","width":1920,"height":1200},"scenes":[{"sceneName":"MainScene","physicsPropertiesVO":{}}],"libraryItems":{"menuButton":{"itemIdentifier":"button","tags":["button"],"x":229,"y":140.33334,"originX":0,"originY":0,"zIndex":1,"layerName":"Default","composite":{"sImage9patchs":[{"tags":[],"x":1.3333335,"y":0.33333325,"originX":2,"originY":8.666667,"layerName":"normal","imageName":"btn","width":45.106346,"height":18.40686},{"tags":[],"x":2.3333333,"y":0.8382262,"originX":2,"originY":7.6666665,"zIndex":1,"layerName":"pressed","imageName":"btnPressed","width":43.06713,"height":17.161774}],"sLabels":[{"tags":[],"x":3.666666,"y":1.3333336,"originX":20,"originY":8.333333,"zIndex":2,"layerName":"text","text":"Button","style":"Berlin Sans FB","size":40,"align":1,"width":40,"height":16.666666}],"layers":[{"layerName":"normal","isVisible":true},{"layerName":"pressed","isVisible":true},{"layerName":"text","isVisible":true}]},"width":46.43968,"height":18.740194}}} -------------------------------------------------------------------------------- /platformer_overlap2d_project/project.pit: -------------------------------------------------------------------------------- 1 | {"projectName":"platformer_overlap2d_project","projectVersion":"0.0.9","projectMainExportPath":"E:\\Work\\Android Dev\\Java\\platformer_tutorial\\core\\assets","lastOpenScene":"MainScene","texturepackerWidth":"1024","texturepackerHeight":"1024","sceneConfigs":[{"sceneName":"MainScene","cameraPosition":[263.53723,116.138794]}]} -------------------------------------------------------------------------------- /platformer_overlap2d_project/scenes/MainScene.dt: -------------------------------------------------------------------------------- 1 | {"sceneName":"MainScene","composite":{"sImages":[{"uniqueId":9,"tags":[],"x":182.66667,"y":35.666668,"originX":0,"originY":0,"zIndex":1,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":5,"tags":[],"x":416.33334,"y":119.333336,"originX":0,"originY":0,"zIndex":2,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":4,"tags":[],"x":343.00003,"y":89.666664,"originX":0,"originY":0,"zIndex":3,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":3,"tags":["platform"],"x":263.33334,"y":65,"originX":0,"originY":0,"zIndex":4,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":6,"tags":["platform"],"x":546.6667,"y":90,"originX":0,"originY":0,"zIndex":5,"layerName":"Default","shape":{"polygons":[[{},{"y":10},{"x":73.333336,"y":10},{"x":73.333336}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform2"},{"uniqueId":15,"tags":[],"x":498.6667,"y":150.66666,"originX":0,"originY":0,"zIndex":7,"layerName":"Default","imageName":"ball"}],"sImage9patchs":[{"uniqueId":8,"tags":[],"x":-349.66666,"y":-17.333334,"originX":38.333336,"originY":13.333334,"layerName":"Default","shape":{"polygons":[[{},{"y":26.666668},{"x":1368.9999,"y":26.666668},{"x":1368.9999}]]},"physics":{"mass":1,"allowSleep":true,"awake":true,"density":1,"friction":1,"restitution":1},"imageName":"paltform1","width":1368.9999,"height":26.666668},{"uniqueId":13,"tags":[],"x":496,"y":9.000002,"originX":15.5,"originY":33.166668,"zIndex":6,"layerName":"Default","imageName":"pillar","width":31,"height":135.66667},{"uniqueId":2,"tags":[],"x":1.6666679,"y":8.666666,"originX":15.5,"originY":33.166668,"zIndex":9,"layerName":"Default","imageName":"pillar","width":31,"height":66.333336}],"sSpriteAnimations":[{"uniqueId":18,"itemIdentifier":"player","tags":[],"x":92,"y":39.333336,"originX":20.666666,"originY":16,"zIndex":8,"layerName":"Default","animationName":"sheep","currentAnimation":"Default","frameRangeMap":[{"name":"Default","endFrame":6}],"playMode":2}],"layers":[{"layerName":"Default","isVisible":true}]},"physicsPropertiesVO":{},"verticalGuides":[266.6667,0.20433554],"horizontalGuides":[160,0.13879395]} -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include 'desktop', 'core' --------------------------------------------------------------------------------