first.
This commit is contained in:
20
desktop/project.clj
Normal file
20
desktop/project.clj
Normal file
@@ -0,0 +1,20 @@
|
||||
(defproject advent "0.0.1-SNAPSHOT"
|
||||
:description "FIXME: write description"
|
||||
|
||||
:dependencies [[com.badlogicgames.gdx/gdx "1.3.0"]
|
||||
[com.badlogicgames.gdx/gdx-backend-lwjgl "1.3.0"]
|
||||
[com.badlogicgames.gdx/gdx-box2d "1.3.0"]
|
||||
[com.badlogicgames.gdx/gdx-box2d-platform "1.3.0"
|
||||
:classifier "natives-desktop"]
|
||||
[com.badlogicgames.gdx/gdx-bullet "1.3.0"]
|
||||
[com.badlogicgames.gdx/gdx-bullet-platform "1.3.0"
|
||||
:classifier "natives-desktop"]
|
||||
[com.badlogicgames.gdx/gdx-platform "1.3.0"
|
||||
:classifier "natives-desktop"]
|
||||
[org.clojure/clojure "1.6.0"]
|
||||
[play-clj "0.3.9"]]
|
||||
|
||||
:source-paths ["src" "src-common"]
|
||||
:javac-options ["-target" "1.6" "-source" "1.6" "-Xlint:-options"]
|
||||
:aot [advent.core.desktop-launcher]
|
||||
:main advent.core.desktop-launcher)
|
||||
BIN
desktop/resources/bg.png
Normal file
BIN
desktop/resources/bg.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.8 KiB |
BIN
desktop/resources/bg2.png
Normal file
BIN
desktop/resources/bg2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.4 KiB |
BIN
desktop/resources/bg2.pxi
Normal file
BIN
desktop/resources/bg2.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/bg3.png
Normal file
BIN
desktop/resources/bg3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
BIN
desktop/resources/bg3.pxi
Normal file
BIN
desktop/resources/bg3.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/left.pxa/0.pxi
Normal file
BIN
desktop/resources/left.pxa/0.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/left.pxa/1.pxi
Normal file
BIN
desktop/resources/left.pxa/1.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/left.pxa/2.pxi
Normal file
BIN
desktop/resources/left.pxa/2.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/left.pxa/3.pxi
Normal file
BIN
desktop/resources/left.pxa/3.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/left.pxa/4.pxi
Normal file
BIN
desktop/resources/left.pxa/4.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/left.pxa/5.pxi
Normal file
BIN
desktop/resources/left.pxa/5.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/left.pxa/6.pxi
Normal file
BIN
desktop/resources/left.pxa/6.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/left.pxa/7.pxi
Normal file
BIN
desktop/resources/left.pxa/7.pxi
Normal file
Binary file not shown.
38
desktop/resources/left.pxa/CelData.plist
Normal file
38
desktop/resources/left.pxa/CelData.plist
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<array>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
</array>
|
||||
</plist>
|
||||
BIN
desktop/resources/pal.pxpalette
Normal file
BIN
desktop/resources/pal.pxpalette
Normal file
Binary file not shown.
BIN
desktop/resources/player.png
Normal file
BIN
desktop/resources/player.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.2 KiB |
BIN
desktop/resources/right.pxa/0.pxi
Normal file
BIN
desktop/resources/right.pxa/0.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/right.pxa/1.pxi
Normal file
BIN
desktop/resources/right.pxa/1.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/right.pxa/2.pxi
Normal file
BIN
desktop/resources/right.pxa/2.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/right.pxa/3.pxi
Normal file
BIN
desktop/resources/right.pxa/3.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/right.pxa/4.pxi
Normal file
BIN
desktop/resources/right.pxa/4.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/right.pxa/5.pxi
Normal file
BIN
desktop/resources/right.pxa/5.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/right.pxa/6.pxi
Normal file
BIN
desktop/resources/right.pxa/6.pxi
Normal file
Binary file not shown.
BIN
desktop/resources/right.pxa/7.pxi
Normal file
BIN
desktop/resources/right.pxa/7.pxi
Normal file
Binary file not shown.
38
desktop/resources/right.pxa/CelData.plist
Normal file
38
desktop/resources/right.pxa/CelData.plist
Normal file
@@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<array>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>duration</key>
|
||||
<real>0.10000000149011612</real>
|
||||
</dict>
|
||||
</array>
|
||||
</plist>
|
||||
47
desktop/src-common/advent/core.clj
Normal file
47
desktop/src-common/advent/core.clj
Normal file
@@ -0,0 +1,47 @@
|
||||
(ns advent.core
|
||||
(:require [play-clj.core :refer :all]
|
||||
[play-clj.ui :refer :all]
|
||||
[play-clj.g2d :refer :all]))
|
||||
|
||||
(defscreen main-screen
|
||||
:on-show
|
||||
(fn [screen entities]
|
||||
(update! screen :renderer (stage) :camera (orthographic))
|
||||
(let [player-sheet (texture! (texture "player.png") :split 18 36)
|
||||
background (texture "bg3.png")]
|
||||
[(assoc background :scale-y 1.0 :scale-x 1.0 :origin-y 0 :origin-x 0 :ego? false :x -60 :y -34)
|
||||
{:right (animation 0.1 (for [i (range 8)]
|
||||
(texture (aget player-sheet 0 i))))
|
||||
:left (animation 0.1 (for [i (range 8)]
|
||||
(texture (aget player-sheet 1 i))))
|
||||
:anim (animation 0.1 (for [i (range 8)]
|
||||
(texture (aget player-sheet 0 i))))
|
||||
:x 0 :y 25 :origin-x 0 :origin-y 0 :x-velocity 1
|
||||
:ego? true}]))
|
||||
|
||||
:on-render
|
||||
(fn [screen entities]
|
||||
(clear!)
|
||||
(render! screen (for [entity entities]
|
||||
(if (:ego? entity)
|
||||
(merge (animation->texture screen (:anim entity))
|
||||
{:ego? (:ego? entity) :x (+ (:x entity) (:x-velocity entity)) :y 0 :origin-x 0 :origin-y 0 :anim (:anim entity) :x-velocity (:x-velocity entity) :left (:left entity) :right (:right entity)}
|
||||
(when (> (:x entity) (width screen))
|
||||
{:x-velocity -1 :anim (:left entity)})
|
||||
(when (< (:x entity) 0)
|
||||
{:x-velocity 1 :anim (:right entity)}))
|
||||
|
||||
entity))))
|
||||
:on-resize
|
||||
(fn [screen entities]
|
||||
(height! screen 135))
|
||||
|
||||
:on-scrolled
|
||||
(fn [screen entities]
|
||||
(set! (. (:camera screen) zoom) (min 1.5 (max (+ (.zoom (:camera screen)) (* 0.01 (:amount screen))) 1)))
|
||||
nil))
|
||||
|
||||
(defgame advent
|
||||
:on-create
|
||||
(fn [this]
|
||||
(set-screen! this main-screen)))
|
||||
10
desktop/src/advent/core/desktop_launcher.clj
Normal file
10
desktop/src/advent/core/desktop_launcher.clj
Normal file
@@ -0,0 +1,10 @@
|
||||
(ns advent.core.desktop-launcher
|
||||
(:require [advent.core :refer :all])
|
||||
(:import [com.badlogic.gdx.backends.lwjgl LwjglApplication]
|
||||
[org.lwjgl.input Keyboard])
|
||||
(:gen-class))
|
||||
|
||||
(defn -main
|
||||
[]
|
||||
(LwjglApplication. advent "advent" 1920 1080)
|
||||
(Keyboard/enableRepeatEvents true))
|
||||
Reference in New Issue
Block a user