New idea: Rogulike randomiser for potion, etc., variable jump height controlled by key pressing time

Former-commit-id: 2408607006af5f29d8ecbd3ced655f2908c97afb
Former-commit-id: 33f03178aa8af54f76ce3b1324b2134173a540ff
This commit is contained in:
Song Minjae
2016-02-24 02:58:25 +09:00
parent 34a04943ab
commit 0b6d8ff44d
13 changed files with 86 additions and 41 deletions

View File

@@ -37,3 +37,9 @@ Topaz -> R·G·B -> Diamond·Amethyst
Natural: Use 4096
Magical/Surreal: Use 24 Bits
= Colouring of potion
- Randomised, roguelike fashion
- Choose Col(R40, G40, B40) from set of finite cards:
39, 39, 19, 19, 0, 0
- MULTIPLY blend chosen colour with white texture

View File

@@ -1,4 +1,4 @@
"STRING_ID";"IETF language tag(s) without dash";"enUS";"frFR";"esES";"deDE";"itIT";"ptBR";"ptPT";"ruRU";"elGR";"trTR";"daDK";"noNB";"svSE";"nlNL";"plPL";"fiFI";"jaJP";"zhCN";"zhTW";"koKR";"csCZ";"huHU";"roRO";"thTH";"bgBG";"heIL";"jakanaJP"
"APP_CALIBRATE_YOUR_MONITOR";;"Best player experience can be achieved with properly calibrated monitor. If you have not, please do it before you play.";"Meilleure expérience de joueur peut être réalisé avec écran correctement calibré. Si vous ne l'avez pas, s.v.p. le calibrez avant de jouer.";;;;;;;;;;;;;;;"このゲームは適切に校正したモニターから最高のプレイができます。校正していなければプレイする前に校正して下さい。";;;"본 게임은 적절히 보정된 모니터에서 최상으로 즐길 수 있습니다. 보정하지 않았다면 플레이하기 전에 보정해 주십시오.";;;;;;;"この ゲームは てきせつに こうせい した モニターから さいこうの プレイが できます。こうせい して いなければ プレイする まえに こうせい して ください。"
"APP_CALIBRATE_YOUR_MONITOR";;"Best player experience can be achieved with properly calibrated monitor. If you have not, please do it before you play.";"Meilleure expérience de joueur peut être réalisé avec écran correctement calibré. Si vous ne l'avez pas, s.v.p. le calibrez avant de jouer.";;;;;;;;;;;;;;;"このゲームは適切に校正したモニターから最高のプレイができます。校正していなければプレイする前に校正して下さい。";;;"본 게임은 적절히 보정된 모니터에서 최상으로 즐길 수 있습니다. 보정하지 않았다면 플레이하기 전에 보정해 주십시오.";;;;;;;"この ゲームは てきせつに こうせい した モニターから さいこうの プレイが できます。こうせい して いなければ プレイする まえに こうせい して ください。"
"COPYRIGHT_MSG";;"All rights reserved.";"Tous les droits sont réservés.";;;;;;;;;;;;;;;"全著作権所有。";;;"모든 권리 보유.";;;;;;;"ぜん ちょさくけん しょゆう。"
1 STRING_ID IETF language tag(s) without dash enUS frFR esES deDE itIT ptBR ptPT ruRU elGR trTR daDK noNB svSE nlNL plPL fiFI jaJP zhCN zhTW koKR csCZ huHU roRO thTH bgBG heIL jakanaJP
2 APP_CALIBRATE_YOUR_MONITOR Best player experience can be achieved with properly calibrated monitor. If you have not, please do it before you play. Meilleure expérience de joueur peut être réalisé avec écran correctement calibré. Si vous ne l'avez pas, s.v.p. le calibrez avant de jouer. このゲームは適切に校正したモニターから最高のプレイができます。校正していなければプレイする前に校正して下さい。 このゲームは、適切に校正したモニターから最高のプレイができます。校正していなければ、プレイする前に校正して下さい。 본 게임은 적절히 보정된 모니터에서 최상으로 즐길 수 있습니다. 보정하지 않았다면 플레이하기 전에 보정해 주십시오. この ゲームは てきせつに こうせい した モニターから さいこうの プレイが できます。こうせい して いなければ プレイする まえに こうせい して ください。
3 COPYRIGHT_MSG All rights reserved. Tous les droits sont réservés. 全著作権所有。 모든 권리 보유. ぜん ちょさくけん しょゆう。
4

View File

@@ -12,7 +12,7 @@
"speed" : 3.0,
"speedvariable" : [100,100,100,100,100,100,100],
"jumppower" : 5.5,
"jumppower" : 5,
"jumppowervariable" : [100,100,100,100,100,100,100],
"scale" : 1,

View File

@@ -44,9 +44,7 @@ public class PBFSigrid {
p.actorValue.set("accel", Player.WALK_ACCEL_BASE);
p.actorValue.set("accelmult", 1.0f);
p.actorValue.set("jumppower", 6.5f);
// in frames
p.actorValue.set("jumplength", 30f);
p.actorValue.set("jumppower", 5f);
p.actorValue.set("basemass", 80f);

View File

@@ -3,8 +3,6 @@ package com.Torvald.Terrarum.Actors;
import com.Torvald.Terrarum.Actors.Faction.Faction;
import com.Torvald.Terrarum.GameControl.EnumKeyFunc;
import com.Torvald.Terrarum.GameControl.KeyMap;
import com.Torvald.Terrarum.MapDrawer.LightmapRenderer;
import com.Torvald.Terrarum.MapDrawer.MapCamera;
import com.Torvald.Terrarum.MapDrawer.MapDrawer;
import com.Torvald.Terrarum.Terrarum;
import com.Torvald.spriteAnimation.SpriteAnimation;
@@ -15,7 +13,6 @@ import org.lwjgl.input.Controller;
import org.lwjgl.input.Controllers;
import org.newdawn.slick.*;
import java.io.Serializable;
import java.util.HashSet;
/**
@@ -25,8 +22,13 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac
@Nullable public Controllable vehicleRiding;
int jumpPowerCounter = 0;
int jumpCounter = 0;
int walkPowerCounter = 0;
private final int MAX_JUMP_LENGTH = 20;
/**
* experimental value.
*/
private final float JUMP_ACCELERATION_MOD = 92f / 10000f;
private final int WALK_FRAMES_TO_MAX_ACCEL = 6;
public float readonly_totalX = 0, readonly_totalY = 0;
@@ -402,8 +404,8 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac
if (!noClip) {
if (super.isGrounded()) {
jumping = true;
jump();
}
jump();
}
else {
walkVertical(true, AXIS_POSMAX);
@@ -411,7 +413,7 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac
}
else {
jumping = false;
jumpPowerCounter = 0;
jumpCounter = 0;
}
}
@@ -420,43 +422,43 @@ public class Player extends ActorWithBody implements Controllable, Pocketed, Fac
}
/**
* See ./work_files/Jump\ power\ by\ pressing\ time.gcx
*/
private void jump() {
float len = actorValue.getAsFloat("jumplength");
if (jumping) {
float len = MAX_JUMP_LENGTH;
float pwr = actorValue.getAsFloat("jumppower");
//if (jumping) {
// // Limit increment of jumpPowerCounter
// if (jumpPowerCounter < len) {
// jumpPowerCounter += 1;
//
// /**
// * Limit jumping
// */
// //super.veloY = jumpFuncSqu(pwr, len);
// super.veloY += jumpFuncLin(pwr, len);
// //super.veloY = jumpFuncExp(pwr, len);
//
// System.out.println(jumpFuncLin(pwr, len));
// }
//
// super.grounded = false;
//}
// increment jump counter
if (jumpCounter < len) jumpCounter += 1;
float sumT = (jumpCounter * (jumpCounter + 1)) / 2f;
float timedJumpCharge = ((len + 1) / 2f) - (sumT / len);
if (timedJumpCharge < 0) timedJumpCharge = 0;
float jumpAcc = pwr * timedJumpCharge * JUMP_ACCELERATION_MOD;
// At least this works, though. Useful if it were AI-controlled.
super.setVeloY(super.getVeloY()
-
pwr * FastMath.sqrt(super.getScale())
- jumpAcc
);
}
// for mob AI:
//super.setVeloY(super.getVeloY()
// -
// pwr * FastMath.sqrt(super.getScale())
//);
}
private float jumpFuncLin(float pwr, float len) {
return -(pwr / len) * jumpPowerCounter;
return -(pwr / len) * jumpCounter;
}
private float jumpFuncSqu(float pwr, float len) {
return (pwr / (len * len))
* (jumpPowerCounter - len)
* (jumpPowerCounter - len) // square
* (jumpCounter - len)
* (jumpCounter - len) // square
- pwr;
}

View File

@@ -37,3 +37,9 @@ Topaz -> R·G·B -> Diamond·Amethyst
Natural: Use 4096
Magical/Surreal: Use 24 Bits
= Colouring of potion
- Randomised, roguelike fashion
- Choose Col(R40, G40, B40) from set of finite cards:
39, 39, 19, 19, 0, 0
- MULTIPLY blend chosen colour with white texture

View File

@@ -35,7 +35,7 @@ public class MapGenerator {
private static int SHORE_WIDTH = 120;
private static int MAX_OCEAN_DEPTH = 200;
private static final int TERRAIN_PERTURB_OFFSETMAX = 32; // [-val , val]
private static final int TERRAIN_PERTURB_OFFSETMAX = 0; // [-val , val]
private static final int TERRAIN_PERTURB_LARGESTFEATURE = 256;
private static final float TERRAIN_PERTURB_RATE = 0.5f;

View File

@@ -0,0 +1,33 @@
package com.Torvald.Terrarum;
import com.Torvald.ColourUtil.Col4096;
import java.util.ArrayList;
import java.util.Hashtable;
/**
* Created by minjaesong on 16-02-23.
*/
public class RoguelikeRandomiser {
private static final int[] POTION_PRIMARY_COLSET = {15, 15, 8, 8, 0, 0};
private static Hashtable<Integer, Col4096> potionColours;
private static ArrayList<Col4096> coloursTaken;
private static final int POTION_HEAL_TIER1 = 0x00;
private static final int POTION_HEAL_TIRE2 = 0x01;
private static final int POTION_MAGIC_REGEN_TIER1 = 0x10;
private static final int POTION_BERSERK_TIER1 = 0x20;
public RoguelikeRandomiser() {
potionColours = new Hashtable<>();
coloursTaken = new ArrayList<>();
}
}