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).

1  
!7
2  
3  
//lib 1005011 // mochadoom
4  
lib 1400282 // mochadoom with key mapping
5  
6  
static int escapeKeyCode = KeyEvent.VK_END; // put zero to not remap
7  
8  
sS defaultCfg = [[
9  
alwaysrun   true
10  
chatmacro0    "No"
11  
chatmacro1    "I'm ready to kick butt!"
12  
chatmacro2    "I'm OK."
13  
chatmacro3    "I'm not looking too good!"
14  
chatmacro4    "Help!"
15  
chatmacro5    "You suck!"
16  
chatmacro6    "Next time, scumbag..."
17  
chatmacro7    "Come here!"
18  
chatmacro8    "I'll take care of it."
19  
chatmacro9    "Yes"
20  
detaillevel   0
21  
fullscreen    true
22  
joyb_fire   0
23  
joyb_speed    2
24  
joyb_strafe   1
25  
joyb_use    3
26  
key_fire    97 // 157
27  
key_left    172
28  
key_right   174
29  
key_speed   182
30  
key_strafe    184
31  
key_strafeleft    105 // 97
32  
key_straferight   106 // 100
33  
key_up    103 // 119
34  
key_down  108 // 115
35  
key_use   57 // 32
36  
mb_used   2
37  
mouse_sensitivity   5
38  
mouseb_fire   0
39  
mouseb_forward    2
40  
mouseb_strafe   1
41  
music_volume    8
42  
screenblocks    10
43  
sfx_volume    8
44  
show_messages   true
45  
snd_channels    3
46  
use_joystick    false
47  
use_mouse   true
48  
usegamma    0
49  
]];
50  
51  
public static void main(S[] args) ctex {
52  
  renameConsole("Mocha DOOM!");
53  
  File iwad = loadLibrary(#1005008);
54  
  File iwad2 = prepareProgramFile("doom1.wad");
55  
  copyFile(iwad, iwad2);
56  
  File iwad3 = new File(iwad2.getName());
57  
  
58  
  if (!iwad3.exists()) {
59  
    if (eq(first(args), "CDed"))
60  
      fail("Can't move to correct directory! " + f2s(iwad3.getAbsoluteFile().getParentFile()) + " (should be " + f2s(programDir()) + ")");
61  
    else {
62  
      classicNohupJavaxWithChdir(programID() + " CDed " + smartJoin(args));
63  
      System.exit(0);
64  
    }
65  
  }
66  
    
67  
  File cfgFile = prepareProgramFile("mochadoom.cfg");
68  
  if (!cfgFile.exists() || cic(args, "-overwritecfg")) {
69  
    args = toStringArray(listMinus(toList(args), "-overwritecfg"));
70  
    saveTextFile(cfgFile, trimAllLines(dropJavaComments(defaultCfg));
71  
  }
72  
    
73  
  S[] argz = eq(first(args), "CDed") ? dropFirst(args) : args;
74  
  if (!cic(argz, "-iwad"))
75  
    argz = concatStringArrays(new S[] {"-iwad", f2s(iwad2)}, argz);
76  
77  
  printStructure(argz);
78  
  g.Signals.keyToMapToEscape = escapeKeyCode;
79  
  mochadoom.Engine.main(argz);
80  
}

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: 380 / 1113
Version history: 18 change(s)
Referenced in: [show references]