チャレンジャー号爆発後、生存していたクルーの会話記録/Javaハッシュによる2次元マップ備忘録/DMM英会話の準備
マレーシア航空370便 交信途絶える直前までの音声記録
【死の直前最後の言葉】チャレンジャー号爆発事故後の通信記録:時速300キロ以上で海に激突するまでの恐怖と絶望の7分間
チャレンジャー事故でクルーは即死ではなかった。
時速300kmで海に激突するまでの会話の記録。
![]() | Killer Game Programming In Java (Fan Book) (2005/06/30) Andrew Davison 商品詳細を見る |
![]() | Developing Games in Java (New Riders Games) (2003/08/14) David Brackeen 商品詳細を見る |
![]() | Beginning Java 8 Games Development (2014/12/03) Wallace Jackson 商品詳細を見る |
![]() | 戦略シミュレーションゲームの作り方 (2014/12/12) GAMKIN株式会社 ロバート・ジェイ・ゴールド 商品詳細を見る |
ハッシュテーブルを利用した2次元ゲームマップ 備忘録
import java.awt.*;
import java.awt.event.*;
import java.applet.*;
import java.awt.image.BufferedImage;
import java.io.IOException;
import java.util.*;
import javax.imageio.ImageIO;
import javax.swing.JApplet;
import java.awt.event.KeyEvent;
public abstract class Rpg55 extends JApplet implements Runnable,KeyListener {
public static final int WIDTH = 448;//1280;
public static final int HEIGHT = 448;//920;
private boolean upkey = false;
private boolean downkey = false;
private boolean rightkey = false;
private boolean leftkey = false;
private boolean spacekey = false;
private boolean enterkey = false;
BufferedImage biPlayer;
//BufferedImage[] lstBiField = new BufferedImage[10];
Map
// マップ
MapField map;
// プレイヤー
Player player;
/**
* コンストラクタ
*/
public Rpg55 (){
// パネルの推奨サイズを設定、pack()するときに必要
setPreferredSize(new Dimension(WIDTH, HEIGHT));
// パネルがキー入力を受け付けるようにする
setFocusable(true);
// キーイベントリスナーを登録
addKeyListener(this);
try {
//biField = ImageIO.read(getClass().getResource("image/field/back0.gif"));
mapBiField.put("0", ImageIO.read(getClass().getResource("image/field/back3.gif")));
mapBiField.put("1", ImageIO.read(getClass().getResource("image/field/back0.gif")));
biPlayer = ImageIO.read(getClass().getResource("image/player/f10.gif"));
//biPlayer = ImageIO.read(getClass().getResource("image/player/f11.gif"));
} catch (IOException e) {
e.printStackTrace();
}
map = new MapField();
player = new Player(1,1,biPlayer);
}
/**
*
*/
public void run() {
while(true){ // 無限ループ
repaint();
try{
Thread.sleep(30); // 30msecごとにrun()内部が実行される
} catch(InterruptedException e){
System.out.println("Interrupted Exception occured!");
}
}
}
/**
* 描画処理
*
* @param 描画オブジェクト
*/
//public void paintComponent(Graphics g) {
public void paint(Graphics g) {
//super.paintComponent(g);
// タイトル画面の描画
g.setColor(Color.black);
g.fillRect(0,0,getWidth(),getHeight());
//g.drawImage(mapBiField.get("0"), 0, 0, this);
//g.drawImage(mapBiField.get(map.getMapData(0, 0)), 0, 0, this);
int fx, fy;
for (int i = 0; i < 7; i++) {
for (int j = 0; j < 7; j++) {
fx = j + player.getMx() - 3;
fy = i + player.getMy() - 3;
if (fx >= 0 && fy >= 0) {
System.out.print(map.getMapData(j, i));
g.drawImage(mapBiField.get(map.getMapData(fx, fy)), j * 64, i * 64, this);
g.drawImage(biPlayer, WIDTH/2 + 64, HEIGHT/2 + 64, this);
}
}
System.out.println();
}
}
/**
*
* @param e
*/
//キー入力処理を書くこと
}
Map
ハッシュに画像の番号と画像をセットで保存する。
mapBiField.put("0", ImageIO.read(getClass().getResource("image/field/back3.gif")));
2次元マップがこれで表現できる。
g.drawImage(mapBiField.get(map.getMapData(fx, fy)), j * 64, i * 64, this);
実際の描画処理の部分。
/////////////////////////
別クラス
/////////////////////////
import java.io.BufferedReader;
import java.io.InputStream;
import java.io.InputStreamReader;
public class MapField {
static final int VIEW_W = 70;
static final int VIEW_H = 70;
String[] mapdata = new String[VIEW_H];
/**
* コンストラクタ
*/
public MapField(){
InputStream is = getClass().getResourceAsStream("map/map.txt");
BufferedReader br = new BufferedReader(new InputStreamReader(is));
try{
for(int i = 0; i < VIEW_W; i++){
mapdata[i] = br.readLine();
if (mapdata[i]==null) {
System.err.println("invalid mapdata");
System.exit(0);
}
}
br.close();
is.close();
} catch(Exception e){
e.printStackTrace();
}
}
/**
* 指定地点のマップデータを取得
* @param x
* @param y
* @return
*/
//int getMapData(int x, int y){
String getMapData(int x, int y){
//return Character.getNumericValue(mapdata[y].charAt(x));
//return mapdata[y].charAt(x);
return mapdata[y].substring(x, x+1);
}
}
////////////////////////////
////////////////////////////
今日のDMM英会話の中の質問と答えの準備
Why do you think most airline pilots are men?
Angela Masson, a retired American Airlines captain who heads the group, said it shouldn't be very surprising that women don't flock to a stressful male-dominated job that requires lots of expensive and continuous training, takes them away from home for large chunks of time and makes it difficult to raise a family.
引用元:CNN
The co-pilot
Attention has focused on the 27-year-old co-pilot, Andreas Lubitz, since a French prosecutor said last week that he appeared to have locked the pilot out of the cockpit and deliberately crashed the plane.
News reports have emerged suggesting Lubitz may have been suffering from mental health problems. Antidepressants were reportedly found at his apartment in Dusseldorf, Germany.
Lubitz had visited an eye doctor because of vision problems, a European government official familiar with the investigation told CNN.
The official said he is not aware of any suicidal tendencies reported by Lubitz to the doctors, but that investigators believe he was suicidal.
Officials say Lubitz had been hiding an illness from his employer. Authorities said investigators found torn-up medical leave notes, including for the day of the crash, in Lubitz's apartment. Germanwings said it had never received a sick note from Lubitz.
引用元:CNN
上に引用したCNNの文章は、今日のDMM英会話のレッスンで喋ろうと思ってること。
今日の予定
ジョギング、DMM英会話、子供の文章の添削作業、職場へ行く、その後、飯田橋の英会話カフェに行く。
昨日の約定
特定 新日鐵住金(株)
[東]5401 現物
- 買 1,000 304 03/30
[09:01] 当日 約定済 1,000株-303.3円[09:01]
特定 日本郵船(株)
[東]9101 現物
- 買 1,000 351 03/30
[08:53] 当日 約定済 1,000株-351円[09:00]
スポンサーサイト