Revert "beginning process of the card game."
This reverts commit 81efd7425a.
|
Before Width: | Height: | Size: 1.2 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
Before Width: | Height: | Size: 1.7 KiB |
@@ -6,7 +6,6 @@
|
||||
[advent.screens.scene :as scene]
|
||||
[advent.screens.dialogue :as dialogue]
|
||||
[advent.screens.inventory :as inventory]
|
||||
[advent.screens.cards :as cards]
|
||||
[clojure.pprint]
|
||||
[advent.pathfind])
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
@@ -17,4 +16,4 @@
|
||||
(defgame advent
|
||||
:on-create
|
||||
(fn [this]
|
||||
(set-screen! this scene/scene dialogue/talking-screen dialogue/choice-screen inventory/inventory-screen cards/card-screen )))
|
||||
(set-screen! this scene/scene dialogue/talking-screen dialogue/choice-screen inventory/inventory-screen)))
|
||||
|
||||
@@ -1,51 +0,0 @@
|
||||
(ns advent.screens.cards
|
||||
(:require [play-clj.core :refer :all]
|
||||
[play-clj.ui :refer :all]
|
||||
[play-clj.utils :refer :all]
|
||||
[play-clj.g2d :refer :all]
|
||||
[clojure.pprint]
|
||||
[advent.pathfind]
|
||||
[clojure.core.async :refer [put! <! <!! >! >!! chan go thread take! alts!!]]
|
||||
)
|
||||
(:import [com.badlogic.gdx.graphics Pixmap Pixmap$Filter Texture Texture$TextureFilter]
|
||||
[com.badlogic.gdx.graphics.g2d TextureRegion]
|
||||
[com.badlogic.gdx.scenes.scene2d.utils Align]
|
||||
[com.badlogic.gdx Screen]))
|
||||
|
||||
(def min-x (+ 16 (* 320 0.1)))
|
||||
(defscreen card-screen
|
||||
:on-show
|
||||
(fn [screen entities]
|
||||
(update! screen :renderer (stage) :camera (orthographic))
|
||||
{:all-cards {:heal-big (texture "cards/heal-big.png")
|
||||
:heal-med (texture "cards/heal-med.png")
|
||||
:heal-small (texture "cards/heal-small.png")
|
||||
:recharge-big (texture "cards/recharge-big.png")
|
||||
:recharge-med (texture "cards/recharge-med.png")
|
||||
:recharge-small (texture "cards/recharge-small.png")}
|
||||
:health-bar (texture "cards/health-bar.png")
|
||||
:mana-bar (texture "cards/mana-bar.png")
|
||||
:bar (texture "cards/bar.png")
|
||||
:player {:hp 65
|
||||
:mana 50
|
||||
:hand [:heal-big :heal-small :recharge-big :recharge-big :recharge-big]}})
|
||||
|
||||
:on-render
|
||||
(fn [screen [entities]]
|
||||
(let [player-hand (for [[c index] (map vector (get-in entities [:player :hand]) (range))]
|
||||
(assoc (get-in entities [:all-cards c]) :x (+ min-x (* index 50)) :y 32))
|
||||
player-health (assoc (get-in entities [:health-bar])
|
||||
:x min-x
|
||||
:y 16
|
||||
:width (* (/ (get-in entities [:player :hp]) 100.0) 50))
|
||||
player-mana (assoc (get-in entities [:mana-bar])
|
||||
:x min-x
|
||||
:y 5
|
||||
:width (get-in entities [:player :mana]))]
|
||||
(render! screen player-hand)
|
||||
(render! screen [player-health (assoc (get-in entities [:bar] ) :x min-x :y 16)])
|
||||
(render! screen [player-mana (assoc (get-in entities [:bar] ) :x min-x :y 5)]))
|
||||
entities)
|
||||
|
||||
:on-resize (fn [screen entities]
|
||||
(size! screen 320 240)))
|
||||
@@ -154,7 +154,7 @@
|
||||
(update! screen :renderer (stage) :camera (orthographic))
|
||||
(let [_ (input! :set-cursor-image (utils/cursor "cursor.png" :main) 0 0)
|
||||
music (sound "town-music.mp3")
|
||||
_ (sound! music :loop 0.30)
|
||||
;;_ (sound! music :loop 0.30)
|
||||
rooms {:inside-house (rooms.inside-house/make screen)
|
||||
:outside-house (rooms.outside-house/make screen)
|
||||
:behind-house (rooms.behind-house/make screen)
|
||||
|
||||