Skip to content

Commit

Permalink
full stage
Browse files Browse the repository at this point in the history
  • Loading branch information
XiaoGeNintendo committed Dec 15, 2019
1 parent 9b46476 commit 91999c9
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 10 deletions.
Binary file modified bin/com/hhs/xgn/stg/type/EntityEnemy.class
Binary file not shown.
45 changes: 45 additions & 0 deletions src/com/hhs/xgn/stg/game/MovingNonSpell.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
package com.hhs.xgn.stg.game;

import com.hhs.xgn.gdx.util.VU;
import com.hhs.xgn.stg.launcher.MainScreen;
import com.hhs.xgn.stg.type.EntityEnemyBullet;
import com.hhs.xgn.stg.type.SpellCard;

public class MovingNonSpell extends SpellCard {
public MovingNonSpell(MainScreen ms){
super(ms,1000,1000,"",false);
}

int frameC=0;
boolean left=true; //currently going left

@Override
public void onFrame() {
frameC++;

if(frameC<=200){
return;
}

if(frameC%180==0){
left=!left;
}

if(frameC%5==0){
SelfAimBullet sab=new SelfAimBullet(obj, 60, getX(), getY());
obj.addEnemyBullet(sab);
}

if(left){
obj.boss.x--;
}else{
obj.boss.x++;
}
super.onFrame();
}

@Override
public void onEnd(){
obj.addItem(new ItemPower(obj, obj.boss.x, obj.boss.y, 5));
}
}
19 changes: 17 additions & 2 deletions src/com/hhs/xgn/stg/game/TestStageBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,27 @@

public class TestStageBuilder extends StageBuilder {

int tick;

@Override
public void onTick(MainScreen ms, float tt) {
if(ms.backgroundC==1){
ms.audio.playBGM("normal",1f);
ms.displaySongName("XZM Theme");
}

if(ms.renderBoss==false){
tick++;

//stage middle??
if(tick<=1200){
if(tick%120==0){
EnemySelfAim esa=new EnemySelfAim(ms, ms.p.x, VU.height+100);
ms.addEnemy(esa);
}
}else{
if(ms.renderBoss){
return;
}
ms.boss=new Boss(ms, "entity/enemy.png", 128, 64, "art/reimu.png","Test Boss",VU.width/2f,300,
new SpellCardAction(ms,
new Dialog("bg/frogscbg.png", "採冱ってるのよ壼仲とも舞栂徨とも[んだんでしょ�\n暴だけŸo•して臨溺が„佞泙襪箸任睨爾辰討襪裡", "-",null),
Expand All @@ -26,9 +39,11 @@ public void onTick(MainScreen ms, float tt) {
),
new TestNonSpellCard(ms),
new TestSpellCard(ms),
new MovingNonSpell(ms),
new TestRandomCard(ms),
new SpellCardAction(ms,
new Dialog("bg/frogscbg.png","あはははは。爺這れだわ匯藍忽をBいたこの暴が、繁gに“けるとは","<","XZM Theme")
new Dialog("bg/frogscbg.png","あはははは。爺這れだわ匯藍忽をBいたこの暴が、繁gに“けるとは",null,"XZM Theme"),
new Dialog("art/reimu.png","TODO: Ending","<","XZM Theme")
)
);
ms.renderBoss=true;
Expand Down
11 changes: 9 additions & 2 deletions src/com/hhs/xgn/stg/type/Boss.java
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public boolean isAppearing() {
return animTime > 0;
}

float kx, ky;
float kx, ky,initx,inity;

public String tachie;

Expand All @@ -44,6 +44,8 @@ public Boss(MainScreen obj, String texture, float sx, float sy, String tachie, S
this.name = name;
this.x = x;
this.y = y;
this.initx=x;
this.inity=y;
this.tachie = tachie;

nowCard = null;
Expand Down Expand Up @@ -88,8 +90,13 @@ public float getCollision() {
public int currentTime;

public void nextSpellCard() {
//restore
x=initx;
y=inity;

// do some animation


if (currentSpellPointer != -1) {
getSpell().onEnd();

Expand Down Expand Up @@ -123,7 +130,7 @@ public void nextSpellCard() {
Actions.removeActor()));
obj.instant.addActor(ok);

float _bonus = ((getSpell().isTimeSpell?getSpell().time:currentTime) / (float) getSpell().time) * getSpell().maxBonus;
float _bonus = calcCurrentBonus();

obj.p.point += _bonus;
Label ok2 = VU
Expand Down
12 changes: 6 additions & 6 deletions src/com/hhs/xgn/stg/type/EntityEnemy.java
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ public void onHit(Entity ano) {
onKill();
}

Label hplost=VU.createLabel(hp+"");
hplost.setFontScale(0.5f,0.5f);
hplost.getStyle().fontColor=Color.RED;
hplost.addAction(Actions.sequence(Actions.alpha(0,2),Actions.removeActor()));
hplost.setPosition(x+VU.easyRandom(-getCollision()/2,getCollision()/2), y+VU.easyRandom(-getCollision()/2,getCollision()/2),Align.center);
obj.instant.addActor(hplost);
// Label hplost=VU.createLabel(hp+"");
// hplost.setFontScale(0.5f,0.5f);
// hplost.getStyle().fontColor=Color.RED;
// hplost.addAction(Actions.sequence(Actions.alpha(0,2),Actions.removeActor()));
// hplost.setPosition(x+VU.easyRandom(-getCollision()/2,getCollision()/2), y+VU.easyRandom(-getCollision()/2,getCollision()/2),Align.center);
// obj.instant.addActor(hplost);
}
}
}

0 comments on commit 91999c9

Please sign in to comment.