Skip to content
This repository has been archived by the owner on Nov 13, 2022. It is now read-only.

Commit

Permalink
-- Engine rework for fixing multi file compilations (groovy only) -- …
Browse files Browse the repository at this point in the history
…(Assets) major updates to WizRobo. Prep for release 0.0.6
  • Loading branch information
Torbuntu committed Jun 12, 2019
1 parent 11cd747 commit fcb80b3
Show file tree
Hide file tree
Showing 28 changed files with 238 additions and 129 deletions.
4 changes: 2 additions & 2 deletions assets/Leikr
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ else
fi
fi

JVM_ARGS="-jar -Xmx1g -XX:+CMSClassUnloadingEnabled"
JVM_ARGS="-Xmx128M -XX:+CMSClassUnloadingEnabled -jar"

exec "$JAVA_COMMAND" $JVM_ARGS "Leikr-0.0.5.jar"
exec "$JAVA_COMMAND" $JVM_ARGS "Leikr-0.0.6.jar"
2 changes: 1 addition & 1 deletion assets/Leikr.bat
Original file line number Diff line number Diff line change
@@ -1 +1 @@
START javaw -jar -Xmx1g -XX:+CMSClassUnloadingEnabled Leikr-0.0.5.jar
START javaw -Xmx128M -XX:+CMSClassUnloadingEnabled -jar Leikr-0.0.6.jar
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
import Player
import Menu

class DogCat extends leikr.Engine {

Player p = new Player()
def p
Menu menu = new Menu()

int mapX = 0, mapY = 0

// Engine methods
void create(){
loadMap("map")
p.makePlayerCat(screen)
music("Map", true)
p = new Player(screen)
}

void update(float delta){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class Player{
float x = 80, y = 20, vx = 0, vy = 0, gv = 2, coin = 0
float x = 110, y = 20, vx = 0, vy = 0, gv = 2, coin = 0

def idleAnimation, walkingAnimation, runningAnimation, jumpingAnimation

Expand All @@ -14,8 +14,7 @@ class Player{

def jumpTime = 12


def makePlayerCat(screen){
def Player(screen){
idleAnimation = screen.makeAnimSprite(0..9 as int[], frameSpeedTen as float[], 2, true)
walkingAnimation = screen.makeAnimSprite(10..19 as int[], frameSpeedTen as float[], 2, true)
runningAnimation = screen.makeAnimSprite(20..27 as int[], frameSpeedEight as float[], 2, true)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import Bullet
import Enemy
import Player

class LeikrShmup extends leikr.Engine {

Player p = new Player()
def bullets = []
def enemies = []

void create(){

}

void update(float delta){
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@

public class MyJavaGame extends leikr.Engine {



int y, sy, t, steam;
public void create(){
y = 20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import java.io.File //for bad guy code test

class Shapes extends leikr.Engine {

int x, y, x2, y2, r, t, amt, rx, ry, cx, cy, cw, ch, cd, cr
int x, y, x2, y2, r, t, amt, rx, ry, i, j

void create(){
x = 120
Expand All @@ -12,35 +12,23 @@ class Shapes extends leikr.Engine {
rx = 120
ry = 80

cx = 25
cy = 25
cw = 50
ch = 50
cd = 1
cr = 1
//println new File("/").list() //bad guy code test
}
void update(float delta){
FPS()
if (cx > 180) cd = -1
if (cx < 25) cd = 1
if (cy > 105) cr = -1
if (cy < 25) cr = 1

cx += cd
cy += cr

}
void render(){
t+=1
// clip(cx, cy, cw, ch)
drawColor(15)
rect(0, 12, 40, 10, true)
for(int i = 0; i < 34; i++){
pixel(i, i+3, 18)
for(j = 0; j < 34; j++){
pixel(j, j+3, 18)
}


for(int i = 0; i < amt; i++){
for(i = 0; i < amt; i++){
x = cos(i / 10 + t/40)*40
y = sin(i / 10 + t/40)*40

Expand Down
13 changes: 13 additions & 0 deletions assets/Programs/WizRobo/Code/Bolt.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class Bolt{
def x = 0
def y = 0
def vx = 0
def width = 8
def height = 8
def spid = 0
def spids = [5, 6, 7, 8]
def charge = 0
def attack = false
def hit = false
def f = false
}
82 changes: 82 additions & 0 deletions assets/Programs/WizRobo/Code/Enemy.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
class Enemy{
def x = 72
def y = 72
def width =8
def height =8
def f =false
def spid = 10
def alive = true
def remove = false
def animTime = 0
def walkAnim = [10, 11, 12, 13]
def waIndex = 0
def keyA = [x: 1, y: 1]
def keyB = [x: 1, y: 1]
def vs
def l
def r
def health

def Enemy(){

}

def Enemy(x, y, vs, l, r, keyA, keyB){
this.x = x
this.y = y
this.vs = vs
this.l = l
this.r = r
this.keyA = keyA
this.keyB = keyB

width = 8
height = 8
f = false
spid = 10
alive = true
remove = false
animTime = 0
walkAnim = [10,11,12,13]
waIndex = 0
}

def Enemy(x, y, vs, l, r, width, height, f, spid, alive, remove, animTime, walkAnim, waIndex, keyA, keyB){
this.x = x
this.y = y
this.vs = vs
this.l = l
this.r = r
this.width = width
this.height = height
this.f = f
this.spid = spid
this.alive = alive
this.remove = remove
this.animTime = animTime
this.walkAnim = walkAnim
this.waIndex = waIndex
this.keyA = keyA
this.keyB = keyB
}

def Enemy(x, y, vs, l, r, width, height, f, spid, alive, remove, animTime, walkAnim, waIndex, keyA, keyB, health){
this.x = x
this.y = y
this.vs = vs
this.l = l
this.r = r
this.width = width
this.height = height
this.f = f
this.spid = spid
this.alive = alive
this.remove = remove
this.animTime = animTime
this.walkAnim = walkAnim
this.waIndex = waIndex
this.keyA = keyA
this.keyB = keyB
this.health = health
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
import Enemy
import Wizard
import Bolt

class WizRobo extends leikr.Engine {
def wizard = [:]
def bolt = [:]
def wizard
def bolt
def enemies = []
def enemy1, enemy2, enemy3, enemy4, enemy5
def enemyDeadSpids = [85,86,87]

def healthSpids = [193,193,193]
Expand Down Expand Up @@ -85,7 +90,7 @@ class WizRobo extends leikr.Engine {
wizard.spid = wizard.jmsid
}
//standing
if(wizard.g && !wizard.w){
if(wizard.g){
wizard.spid = 0
}

Expand Down Expand Up @@ -235,14 +240,10 @@ class WizRobo extends leikr.Engine {

// INIT methods
void init(){
wizard = [x: 10, y: 100, vx: 0, vy: 0, width: 8, height: 8, spid: 0, f: false, g: true, jmsid: 4,
jumping: false, s: false, walkAnim: [1,2,3,0], waIndex: 0, walking: false,
waTime: 0, left: "Left", right: "Right", up: "Space", down:"Down", charged: false, chargedTime: 0, cf: false,
scrolls: 0, health: 3]

bolt = [x:0, y:0, vx:0, width:8, height:8, spid: 0, spids: [5,6,7,8], charge: 0, attack: false, hit: false]
wizard = new Wizard()
bolt = new Bolt()

def enemy1 = [x: 72, y: 72, width:8, height:8, f:false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 1, y: 1], keyB: [x: 1, y: 1]]
def enemy1 = new Enemy()
enemies = [] // only needed when the game loops around during development.
enemies.add(enemy1)

Expand All @@ -253,8 +254,8 @@ class WizRobo extends leikr.Engine {
wizard.x = 10
wizard.y = 144

def enemy1 = [x: 208, y: 64, vs: 0.2, l: 208, r: 224, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 28, y: 3], keyB: [x:28, y:2]]
def enemy2 = [x: 64, y: 80, vs: 0, l:64, r:64, width: 8, height: 8, f:false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 29, y: 3], keyB: [x:29, y:2]]
def enemy1 = new Enemy(208, 64, 0.2, 208, 224, [x: 28, y: 3], [x:28, y:2])
def enemy2 = new Enemy( 64, 80, 0, 64, 64, [x: 29, y: 3], [x:29, y:2])
enemies = []
enemies.addAll([enemy1, enemy2])
loadMap("lvl1")
Expand All @@ -264,9 +265,9 @@ class WizRobo extends leikr.Engine {
wizard.x = 0
wizard.y = 24

def enemy1 = [x: 72, y: 96, vs: 0.2, l:72, r:88, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 27, y: 17], keyB: [x:28, y:17]]
def enemy2 = [x: 152, y: 72, vs: 0.2, l:152, r:168, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 27, y: 18], keyB: [x:28, y:18]]
def enemy3 = [x: 208, y: 72, vs: 0.2, l: 208, r:224, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 27, y: 19], keyB: [x:28, y:19]]
def enemy1 = new Enemy( 72, 96, 0.2, 72, 88, [x: 27, y: 17], [x:28, y:17])
def enemy2 = new Enemy( 152, 72, 0.2, 152, 168, [x: 27, y: 18], [x:28, y:18])
def enemy3 = new Enemy( 208, 72, 0.2, 208, 224, [x: 27, y: 19], [x:28, y:19])
enemies = []
enemies.addAll([enemy1, enemy2, enemy3])
loadMap("lvl2")
Expand All @@ -276,10 +277,10 @@ class WizRobo extends leikr.Engine {
wizard.x = 220
wizard.y = 0

def enemy1 = [x: 8, y: 64, vs: 0.2, l:8, r:24, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 26, y: 13], keyB: [x:26, y:14]]
def enemy2 = [x: 8, y: 144, vs: 0.2, l:8, r:56, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 27, y: 13], keyB: [x:27, y:14]]
def enemy3 = [x: 184, y: 80, vs: 0.2, l:184, r:200, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 28, y: 13], keyB: [x:28, y:14]]
def enemy4 = [x: 32, y: 80, vs: 0.2, l:32, r:48, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 29, y: 13], keyB: [x:29, y:14]]
def enemy1 = new Enemy( 8, 64, 0.2, 8, 24, [x: 26, y: 13], [x:26, y:14])
def enemy2 = new Enemy( 8, 144, 0.2, 8, 56, [x: 27, y: 13], [x:27, y:14])
def enemy3 = new Enemy( 184, 80, 0.2, 184, 200, [x: 28, y: 13], [x:28, y:14])
def enemy4 = new Enemy( 32, 80, 0.2, 32, 48, [x: 29, y: 13], [x:29, y:14])
enemies = []
enemies.addAll([enemy1, enemy2, enemy3, enemy4])

Expand All @@ -290,11 +291,11 @@ class WizRobo extends leikr.Engine {
wizard.x = 10
wizard.y = 110

def enemy1 = [x: 24, y: 88, vs: 0.2, l:24, r:40, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 3, y: 17], keyB: [x:3, y:18]]
def enemy2 = [x: 96, y: 88, vs: 0.2, l:96, r:104, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 17, y: 2], keyB: [x:17, y:3]]
def enemy3 = [x: 96, y: 24, vs: 0.2, l:56, r:128, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 29, y: 9], keyB: [x:29, y:10]]
def enemy4 = [x: 8, y: 144, vs: 0.2, l:8, r:16, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 28, y: 10], keyB: [x:28, y:9]]
def enemy5 = [x: 168, y: 80, vs: 0.2, l:168, r:168, width: 8, height: 8, f: false, spid: 10, alive: true, remove: false, animTime: 0, walkAnim: [10,11,12,13], waIndex: 0, keyA: [x: 27, y: 9], keyB: [x:27, y:10]]
def enemy1 = new Enemy( 24, 88, 0.2, 24, 40, [x: 3, y: 17], [x:3, y:18])
def enemy2 = new Enemy( 96, 88, 0.2, 96, 104, [x: 17, y: 2], [x:17, y:3])
def enemy3 = new Enemy( 96, 24, 0.2, 56, 128, [x: 29, y: 9], [x:29, y:10])
def enemy4 = new Enemy( 8, 144, 0.2, 8, 16, [x: 28, y: 10], [x:28, y:9])
def enemy5 = new Enemy( 168, 80, 0.2, 168, 168, [x: 27, y: 9], [x:27, y:10])
enemies = []
enemies.addAll([enemy1, enemy2, enemy3, enemy4, enemy5])

Expand All @@ -304,9 +305,8 @@ class WizRobo extends leikr.Engine {
void initlvl5(){
wizard.x = 10
wizard.y = 80


def enemy1 = [x: 40, y: 72, vs: 0.6, l: 40, r: 184, width: 32, height: 32, f: false, spid: 60, alive: true, remove: false, animTime: 0, walkAnim: [60,61,62,63], waIndex: 0, keyA: [x: 27, y: 1], keyB: [x:28, y:1], health: 8]
def enemy1 = new Enemy(40, 72, 0.6, 40, 184, 32, 32, false, 60, true, false, 0, [60,61,62,63], 0, [x: 27, y: 1], [x:28, y:1], 8)
enemies = [] // only needed when the game loops around during development.
enemies.add(enemy1)

Expand All @@ -317,9 +317,9 @@ class WizRobo extends leikr.Engine {
wizard.x = 10
wizard.y = 100

def enemy1 = [x: 190, y: 120, vs: 0.2, l: 8, r: 200, width: 32, height: 32, f: false, spid: 60, alive: true, remove: false, animTime: 0, walkAnim: [60,61,62,63], waIndex: 0, keyA: [x: 28, y: 3], keyB: [x:28, y:2], health: 8]
def enemy1 = new Enemy(190, 120, 0.2, 8, 200, 32, 32, false, 60, true, false, 0, [60,61,62,63], 0, [x: 28, y: 3], [x:28, y:2], 8)

def enemy2 = [x: 30, y: 120, vs: 0.6, l: 8, r: 200, width: 32, height: 32, f: false, spid: 60, alive: true, remove: false, animTime: 0, walkAnim: [60,61,62,63], waIndex: 0, keyA: [x: 28, y: 3], keyB: [x:28, y:2], health: 8]
def enemy2 = new Enemy(30, 120, 0.6, 8, 200, 32, 32, false, 60, true, false, 0, [60,61,62,63], 0, [x: 28, y: 3], [x:28, y:2], 8)

enemies = []
enemies.addAll([enemy1,enemy2])
Expand Down Expand Up @@ -770,7 +770,7 @@ class WizRobo extends leikr.Engine {
sprite(9, (wizard.x).toFloat(), (wizard.y-8).toFloat(), wizard.cf, false)
}
sprite(wizard.spid, wizard.x.toFloat(), wizard.y.toFloat(), wizard.f, false)
if(wizard.walking) walkingDust()
// if(wizard.walking) walkingDust()
if(bolt.attack){
sprite(bolt.spid, bolt.x, bolt.y, bolt.f, false)
}
Expand Down
Loading

0 comments on commit fcb80b3

Please sign in to comment.