Bug Fixes
Player Placement Basic Player Movement
This commit is contained in:
BIN
assets/fonts/dogicapixel.ttf
Normal file
BIN
assets/fonts/dogicapixel.ttf
Normal file
Binary file not shown.
@@ -35,19 +35,29 @@
|
|||||||
"y":0
|
"y":0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"data":[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 120, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0],
|
"draworder":"topdown",
|
||||||
"height":15,
|
"id":5,
|
||||||
"id":4,
|
"name":"objects",
|
||||||
"name":"Tile Layer 3",
|
"objects":[
|
||||||
|
{
|
||||||
|
"height":16,
|
||||||
|
"id":1,
|
||||||
|
"name":"player",
|
||||||
|
"rotation":0,
|
||||||
|
"type":"player",
|
||||||
|
"visible":true,
|
||||||
|
"width":16,
|
||||||
|
"x":16,
|
||||||
|
"y":32
|
||||||
|
}],
|
||||||
"opacity":1,
|
"opacity":1,
|
||||||
"type":"tilelayer",
|
"type":"objectgroup",
|
||||||
"visible":true,
|
"visible":true,
|
||||||
"width":20,
|
|
||||||
"x":0,
|
"x":0,
|
||||||
"y":0
|
"y":0
|
||||||
}],
|
}],
|
||||||
"nextlayerid":5,
|
"nextlayerid":6,
|
||||||
"nextobjectid":1,
|
"nextobjectid":2,
|
||||||
"orientation":"orthogonal",
|
"orientation":"orthogonal",
|
||||||
"renderorder":"right-down",
|
"renderorder":"right-down",
|
||||||
"tiledversion":"1.5.0",
|
"tiledversion":"1.5.0",
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<map version="1.5" tiledversion="1.5.0" orientation="orthogonal" renderorder="right-down" width="20" height="15" tilewidth="16" tileheight="16" infinite="0" nextlayerid="5" nextobjectid="1">
|
<map version="1.5" tiledversion="1.5.0" orientation="orthogonal" renderorder="right-down" width="20" height="15" tilewidth="16" tileheight="16" infinite="0" nextlayerid="6" nextobjectid="2">
|
||||||
<editorsettings>
|
<editorsettings>
|
||||||
<export target="level1.json" format="json"/>
|
<export target="level1.json" format="json"/>
|
||||||
</editorsettings>
|
</editorsettings>
|
||||||
@@ -42,23 +42,7 @@
|
|||||||
127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127
|
127,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,127
|
||||||
</data>
|
</data>
|
||||||
</layer>
|
</layer>
|
||||||
<layer id="4" name="Tile Layer 3" width="20" height="15">
|
<objectgroup id="5" name="objects">
|
||||||
<data encoding="csv">
|
<object id="1" name="player" type="player" x="16" y="32" width="16" height="16"/>
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
</objectgroup>
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
|
|
||||||
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
|
|
||||||
</data>
|
|
||||||
</layer>
|
|
||||||
</map>
|
</map>
|
||||||
|
|||||||
BIN
assets/musics/Juhani Junkala [Retro Game Music Pack] Ending.wav
Normal file
BIN
assets/musics/Juhani Junkala [Retro Game Music Pack] Ending.wav
Normal file
Binary file not shown.
@@ -39,5 +39,6 @@ class Config {
|
|||||||
|
|
||||||
setupFonts() {
|
setupFonts() {
|
||||||
Font.load("font_title", "assets/fonts/lunchds.ttf", 20)
|
Font.load("font_title", "assets/fonts/lunchds.ttf", 20)
|
||||||
|
Font.load("font_minecraft", "assets/fonts/dogicapixel.ttf", 8)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
31
entities/player_entity.wren
Normal file
31
entities/player_entity.wren
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
import "graphics" for ImageData, Canvas
|
||||||
|
import "./controls" for Controls
|
||||||
|
import "./config" for Config
|
||||||
|
class Player {
|
||||||
|
construct new(x,y) {
|
||||||
|
_x = x
|
||||||
|
_y = y
|
||||||
|
|
||||||
|
_playerSprite = ImageData.loadFromFile("assets/sprites/player.png")
|
||||||
|
}
|
||||||
|
|
||||||
|
update() {
|
||||||
|
if(Controls.isKeyDown(Config.KeyboardConstants["UP"])) {
|
||||||
|
_y = _y - 1
|
||||||
|
}
|
||||||
|
if(Controls.isKeyDown(Config.KeyboardConstants["DOWN"])) {
|
||||||
|
_y = _y + 1
|
||||||
|
}
|
||||||
|
if(Controls.isKeyDown(Config.KeyboardConstants["LEFT"])) {
|
||||||
|
_x = _x - 1
|
||||||
|
}
|
||||||
|
if(Controls.isKeyDown(Config.KeyboardConstants["RIGHT"])) {
|
||||||
|
_x = _x + 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
draw(dt) {
|
||||||
|
Canvas.draw(_playerSprite,_x,_y)
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,12 +1,27 @@
|
|||||||
import "audio" for AudioEngine
|
import "audio" for AudioEngine
|
||||||
import "dome" for Window
|
import "dome" for Window
|
||||||
|
import "screens/menu_screen" for MenuScreen
|
||||||
|
import "screens/credit_screen" for CreditScreen
|
||||||
|
import "levels/level1" for Level1
|
||||||
|
import "levels/level2" for Level2
|
||||||
class GameState {
|
class GameState {
|
||||||
construct new() {
|
construct new() {
|
||||||
AudioEngine.load("menu_music","assets/musics/04 All of Us - Menu.ogg")
|
AudioEngine.load("menu_music","assets/musics/04 All of Us - Menu.ogg")
|
||||||
AudioEngine.load("level1_bg","assets/musics/01 A Night Of Dizzy Spells.ogg")
|
AudioEngine.load("level1_bg","assets/musics/01 A Night Of Dizzy Spells.ogg")
|
||||||
AudioEngine.load("select","assets/sfx/select.wav")
|
AudioEngine.load("select","assets/sfx/select.wav")
|
||||||
|
AudioEngine.load("credit","assets/musics/Juhani Junkala [Retro Game Music Pack] Ending.wav")
|
||||||
_fullScreen = false
|
_fullScreen = false
|
||||||
|
|
||||||
|
setupStates()
|
||||||
|
}
|
||||||
|
|
||||||
|
setupStates() {
|
||||||
|
__gameStates = {
|
||||||
|
"menu": MenuScreen,
|
||||||
|
"credit": CreditScreen,
|
||||||
|
"level1": Level1,
|
||||||
|
"level2": Level2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
toggleFullscreen() {
|
toggleFullscreen() {
|
||||||
@@ -16,8 +31,8 @@ class GameState {
|
|||||||
|
|
||||||
switch(level) {
|
switch(level) {
|
||||||
AudioEngine.stopAllChannels()
|
AudioEngine.stopAllChannels()
|
||||||
_currentLevel = level.new(this)
|
_currentLevel = __gameStates[level].new(this)
|
||||||
System.print("Current Level : %(level.name)")
|
System.print("Current Level : %(__gameStates[level].name)")
|
||||||
}
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
|
|||||||
@@ -2,4 +2,10 @@
|
|||||||
class LayerType {
|
class LayerType {
|
||||||
static Tile { "tilelayer" }
|
static Tile { "tilelayer" }
|
||||||
static Object { "objectgroup" }
|
static Object { "objectgroup" }
|
||||||
|
}
|
||||||
|
|
||||||
|
class ObjectType {
|
||||||
|
static PLAYER { "player" }
|
||||||
|
static NPC { "npc" }
|
||||||
|
static ENEMY { "enemy" }
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
import "json" for Json
|
import "json" for Json
|
||||||
import "graphics" for ImageData
|
import "graphics" for ImageData
|
||||||
import "math" for Math
|
import "math" for Math
|
||||||
import "./layer_type" for LayerType
|
import "./layer_type" for LayerType, ObjectType
|
||||||
|
import "./entities/player_entity" for Player
|
||||||
class LevelMap {
|
class LevelMap {
|
||||||
construct new(mapName) {
|
construct new(mapName) {
|
||||||
_mapData = Json.load("assets/%(mapName).json")
|
_mapData = Json.load("assets/%(mapName).json")
|
||||||
@@ -17,9 +17,45 @@ class LevelMap {
|
|||||||
_layers = _mapData["layers"]
|
_layers = _mapData["layers"]
|
||||||
_rows = Math.floor(_tileSheetW/_tileW)
|
_rows = Math.floor(_tileSheetW/_tileW)
|
||||||
_cols = Math.floor(_tileSheetH/_tileH)
|
_cols = Math.floor(_tileSheetH/_tileH)
|
||||||
|
_playerPos = {
|
||||||
|
"x": 0,
|
||||||
|
"y": 0
|
||||||
|
}
|
||||||
|
placeObjects()
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
draw(x, y) {
|
playerPos = (position) {
|
||||||
|
_playerPos = position
|
||||||
|
}
|
||||||
|
|
||||||
|
playerPos { _playerPos }
|
||||||
|
|
||||||
|
placeObjects() {
|
||||||
|
for(layer in _layers) {
|
||||||
|
if(layer["type"] == LayerType.Object) {
|
||||||
|
for(object in layer["objects"]) {
|
||||||
|
if(object["type"]==ObjectType.PLAYER) {
|
||||||
|
playerPos = {
|
||||||
|
"x": object["x"],
|
||||||
|
"y": object["y"]
|
||||||
|
}
|
||||||
|
_player = Player.new(playerPos["x"], playerPos["y"])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
draw(dt) {
|
||||||
|
_player.draw(dt)
|
||||||
|
}
|
||||||
|
|
||||||
|
update() {
|
||||||
|
_player.update()
|
||||||
|
}
|
||||||
|
|
||||||
|
render(x, y) {
|
||||||
var startX = x
|
var startX = x
|
||||||
var startY = y
|
var startY = y
|
||||||
for(layer in _layers) {
|
for(layer in _layers) {
|
||||||
|
|||||||
@@ -1,17 +1,24 @@
|
|||||||
import "./level_map" for LevelMap
|
import "./level_map" for LevelMap
|
||||||
import "audio" for AudioEngine
|
import "audio" for AudioEngine
|
||||||
class Level1 {
|
import "./controls" for Controls
|
||||||
|
import "./config" for Config
|
||||||
|
class Level1 {
|
||||||
construct new(gameState) {
|
construct new(gameState) {
|
||||||
|
__gameState = gameState
|
||||||
_level1 = LevelMap.new("level1")
|
_level1 = LevelMap.new("level1")
|
||||||
var channel = AudioEngine.play("level1_bg")
|
var channel = AudioEngine.play("level1_bg")
|
||||||
channel.volume = 0.2
|
channel.volume = 0.2
|
||||||
}
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
|
if(Controls.justPressed(Config.KeyboardConstants["ATTACK"])) {
|
||||||
|
}
|
||||||
|
|
||||||
|
_level1.update()
|
||||||
}
|
}
|
||||||
|
|
||||||
draw(dt) {
|
draw(dt) {
|
||||||
_level1.draw(0,0)
|
_level1.render(0,0)
|
||||||
|
_level1.draw(dt)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3,10 +3,9 @@ import "json" for Json
|
|||||||
import "graphics" for Canvas, Color
|
import "graphics" for Canvas, Color
|
||||||
import "dome" for Window, Process
|
import "dome" for Window, Process
|
||||||
import "math" for Math
|
import "math" for Math
|
||||||
import "config" for Config
|
import "./config" for Config
|
||||||
import "./controls" for Controls
|
import "./controls" for Controls
|
||||||
import "./game_state" for GameState
|
import "./game_state" for GameState
|
||||||
import "./screens/menu_screen" for MenuScreen
|
|
||||||
|
|
||||||
class Main {
|
class Main {
|
||||||
construct new() {
|
construct new() {
|
||||||
@@ -15,7 +14,7 @@ class Main {
|
|||||||
init() {
|
init() {
|
||||||
Config.new()
|
Config.new()
|
||||||
__gameState = GameState.new()
|
__gameState = GameState.new()
|
||||||
__gameState.switch(MenuScreen)
|
__gameState.switch("menu")
|
||||||
}
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
|
|||||||
@@ -1,13 +1,88 @@
|
|||||||
class CreditScreen {
|
import "./controls" for Controls
|
||||||
construct new() {
|
import "./config" for Config
|
||||||
|
import "audio" for AudioEngine
|
||||||
|
import "font" for Font
|
||||||
|
import "graphics" for Canvas, Color
|
||||||
|
|
||||||
|
class CreditScreen {
|
||||||
|
construct new(gameState) {
|
||||||
|
__gameState = gameState
|
||||||
|
var channel = AudioEngine.play("credit", 0.5, true)
|
||||||
|
__credits = [
|
||||||
|
{
|
||||||
|
"text": "A GAME BY",
|
||||||
|
"padding": 10,
|
||||||
|
"type": "title"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "Indrajith K L",
|
||||||
|
"padding": 30
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "TILESETS & SPRITES",
|
||||||
|
"padding": 50,
|
||||||
|
"type": "title"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "kenney.nl",
|
||||||
|
"padding": 70
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "MUSIC",
|
||||||
|
"padding": 90,
|
||||||
|
"type": "title"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "Juhani Junkala & Eric Skiff",
|
||||||
|
"padding": 110
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "SFX",
|
||||||
|
"padding": 130,
|
||||||
|
"type": "title"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "sfxr",
|
||||||
|
"padding": 150
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "For More Games",
|
||||||
|
"padding": 170,
|
||||||
|
"type": "title"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"text": "indrajithmakesgames.com",
|
||||||
|
"padding": 190,
|
||||||
|
"type": "info"
|
||||||
|
}
|
||||||
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
|
if(Controls.justPressed(Config.KeyboardConstants["ATTACK"])) {
|
||||||
|
__gameState.switch("menu")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
draw(dt) {
|
draw(dt) {
|
||||||
|
var x = 0
|
||||||
|
var y = 10
|
||||||
|
for(credit in __credits) {
|
||||||
|
drawCredit(credit, x, y)
|
||||||
|
var y = y + 10
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
drawCredit(credit, x, y) {
|
||||||
|
x = Config.W/2 - ((credit["text"].count * 8)/2)
|
||||||
|
y = credit["padding"] + y
|
||||||
|
Canvas.print(credit["text"],x ,y , Color.white, credit["type"]=="info" ? "font_minecraft": Font.default)
|
||||||
|
if(credit["type"]=="title") {
|
||||||
|
x = x
|
||||||
|
for(i in 0...(credit["text"].count)) {
|
||||||
|
Canvas.print("-",x ,y+8 , Color.white, Font.default)
|
||||||
|
x = x + 8
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,42 +1,41 @@
|
|||||||
import "graphics" for Canvas, Color
|
import "graphics" for Canvas, Color
|
||||||
import "./controls" for Controls
|
import "./controls" for Controls
|
||||||
import "config" for Config
|
import "./config" for Config
|
||||||
import "levels/level1" for Level1
|
|
||||||
import "screens/credit_screen" for CreditScreen
|
|
||||||
import "audio" for AudioEngine
|
import "audio" for AudioEngine
|
||||||
import "font" for Font
|
import "font" for Font
|
||||||
import "math" for Math
|
import "math" for Math
|
||||||
|
import "dome" for Platform
|
||||||
|
|
||||||
class MenuScreen {
|
class MenuScreen {
|
||||||
construct new(gameState) {
|
construct new(gameState) {
|
||||||
__gameState = gameState
|
__gameState = gameState
|
||||||
// var channel = AudioEngine.play("menu_music")
|
var channel = AudioEngine.play("menu_music", 0.5, true)
|
||||||
// channel.volume = 0.5
|
|
||||||
_selectedMenuIdx = 0
|
_selectedMenuIdx = 0
|
||||||
_prevMenuIdx = 0
|
_prevMenuIdx = 0
|
||||||
_fadeFrame = 255
|
_fadeFrame = 255
|
||||||
|
_fadeSelector = 255
|
||||||
_menuItems = [
|
_menuItems = [
|
||||||
{
|
{
|
||||||
"name": "Start",
|
"name": "Start",
|
||||||
"selected": true,
|
"selected": true,
|
||||||
"class": Level1,
|
"state": "level1",
|
||||||
"font": Font.default,
|
"font": Font.default,
|
||||||
"padding": 20
|
"padding": 20
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Credits",
|
"name": "Credits",
|
||||||
"selected": false,
|
"selected": false,
|
||||||
"class": CreditScreen,
|
"state": "credit",
|
||||||
"font": Font.default,
|
"font": Font.default,
|
||||||
"padding": 40
|
"padding": 40
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
_time = 0
|
||||||
}
|
}
|
||||||
|
|
||||||
update() {
|
update() {
|
||||||
if(Controls.isKeyDown(Config.KeyboardConstants["SELECT"])) {
|
if(Controls.justPressed(Config.KeyboardConstants["ATTACK"])) {
|
||||||
__gameState.switch(Level1)
|
__gameState.switch(_menuItems[_selectedMenuIdx]["state"])
|
||||||
}
|
}
|
||||||
|
|
||||||
if(Controls.justPressed(Config.KeyboardConstants["UP"])) {
|
if(Controls.justPressed(Config.KeyboardConstants["UP"])) {
|
||||||
@@ -63,11 +62,13 @@ class MenuScreen {
|
|||||||
_menuItems[_prevMenuIdx]["selected"] = false
|
_menuItems[_prevMenuIdx]["selected"] = false
|
||||||
_menuItems[_selectedMenuIdx]["selected"] = true
|
_menuItems[_selectedMenuIdx]["selected"] = true
|
||||||
}
|
}
|
||||||
|
|
||||||
// _fadeFrame = (_fadeFrame+3) > 255 ? 0 : _fadeFrame + 3
|
|
||||||
|
|
||||||
_fadeFrame = Math.floor(127 + (127 * Math.cos(System.clock)))
|
_fadeFrame = Math.floor(127 + (127 * Math.cos(System.clock)))
|
||||||
System.print(_fadeFrame)
|
_fadeSelector = inOutQuad(_time, 0, 255, 50)
|
||||||
|
if (_time>51) {
|
||||||
|
_time = 0
|
||||||
|
} else {
|
||||||
|
_time = _time + 1
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
draw(dt) {
|
draw(dt) {
|
||||||
@@ -90,14 +91,25 @@ class MenuScreen {
|
|||||||
var y = Config.H/2 + menuItem["padding"]
|
var y = Config.H/2 + menuItem["padding"]
|
||||||
Canvas.print(menuItem["name"],x ,y , menuItem["selected"] ? Color.red : Color.white, menuItem["font"])
|
Canvas.print(menuItem["name"],x ,y , menuItem["selected"] ? Color.red : Color.white, menuItem["font"])
|
||||||
if(menuItem["selected"]) {
|
if(menuItem["selected"]) {
|
||||||
Canvas.print(">",x - 10 ,y , Color.red, menuItem["font"])
|
Canvas.print(">",x - 10 ,y , Color.new(255, 0, 77, _fadeSelector), menuItem["font"])
|
||||||
}
|
}
|
||||||
// Canvas.print("Credits", Config.W/2 - 28, Config.H/2 + 40, Color.white, Font.default)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
drawBlinker() {
|
drawBlinker() {
|
||||||
Canvas.print("Press X to start",Config.W/2 - 64,Config.H/2 + 100, Color.new(255, 255, 255, _fadeFrame), Font.default)
|
Canvas.print("Press X to select",Config.W/2 - 64,Config.H/2 + 100, Color.new(255, 255, 255, _fadeFrame), Font.default)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inOutQuad(t, b, c, d) {
|
||||||
|
t = t / d * 2
|
||||||
|
if( t < 1 ) {
|
||||||
|
return Math.abs(Math.floor(((c / 2) * (t.pow(2))) + b))
|
||||||
|
} else {
|
||||||
|
return Math.abs(Math.floor(((-c / 2) * ((t - 1) * (t - 3) - 1)) + b))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user