Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

80
LINES

< > BotCompany Repo | #1025148 // Mocha DOOM [newer version with end mapped to escape, OK]

JavaX source code (desktop) [tags: use-pretranspiled] - run with: x30.jar

Download Jar. Uses 0K of libraries. Click here for Pure Java version (5946L/43K).

!7

//lib 1005011 // mochadoom
lib 1400282 // mochadoom with key mapping

static int escapeKeyCode = KeyEvent.VK_END; // put zero to not remap

sS defaultCfg = [[
alwaysrun   true
chatmacro0    "No"
chatmacro1    "I'm ready to kick butt!"
chatmacro2    "I'm OK."
chatmacro3    "I'm not looking too good!"
chatmacro4    "Help!"
chatmacro5    "You suck!"
chatmacro6    "Next time, scumbag..."
chatmacro7    "Come here!"
chatmacro8    "I'll take care of it."
chatmacro9    "Yes"
detaillevel   0
fullscreen    true
joyb_fire   0
joyb_speed    2
joyb_strafe   1
joyb_use    3
key_fire    97 // 157
key_left    172
key_right   174
key_speed   182
key_strafe    184
key_strafeleft    105 // 97
key_straferight   106 // 100
key_up    103 // 119
key_down  108 // 115
key_use   57 // 32
mb_used   2
mouse_sensitivity   5
mouseb_fire   0
mouseb_forward    2
mouseb_strafe   1
music_volume    8
screenblocks    10
sfx_volume    8
show_messages   true
snd_channels    3
use_joystick    false
use_mouse   true
usegamma    0
]];

public static void main(S[] args) ctex {
  renameConsole("Mocha DOOM!");
  File iwad = loadLibrary(#1005008);
  File iwad2 = prepareProgramFile("doom1.wad");
  copyFile(iwad, iwad2);
  File iwad3 = new File(iwad2.getName());
  
  if (!iwad3.exists()) {
    if (eq(first(args), "CDed"))
      fail("Can't move to correct directory! " + f2s(iwad3.getAbsoluteFile().getParentFile()) + " (should be " + f2s(programDir()) + ")");
    else {
      classicNohupJavaxWithChdir(programID() + " CDed " + smartJoin(args));
      System.exit(0);
    }
  }
    
  File cfgFile = prepareProgramFile("mochadoom.cfg");
  if (!cfgFile.exists() || cic(args, "-overwritecfg")) {
    args = toStringArray(listMinus(toList(args), "-overwritecfg"));
    saveTextFile(cfgFile, trimAllLines(dropJavaComments(defaultCfg));
  }
    
  S[] argz = eq(first(args), "CDed") ? dropFirst(args) : args;
  if (!cic(argz, "-iwad"))
    argz = concatStringArrays(new S[] {"-iwad", f2s(iwad2)}, argz);

  printStructure(argz);
  g.Signals.keyToMapToEscape = escapeKeyCode;
  mochadoom.Engine.main(argz);
}

Author comment

Began life as a copy of #1005012

download  show line numbers  debug dex  old transpilations   

Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

-
Snippet ID: #1025148
Snippet name: Mocha DOOM [newer version with end mapped to escape, OK]
Eternal ID of this version: #1025148/19
Text MD5: f0c4073634fa9af838950b5e7523c7f1
Transpilation MD5: 2a482cc019e92424974d03767aefb792
Author: stefan
Category: javax / games
Type: JavaX source code (desktop)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-09-09 14:59:53
Source code size: 2162 bytes / 80 lines
Pitched / IR pitched: No / No
Views / Downloads: 402 / 1178
Version history: 18 change(s)
Referenced in: