Posts

Showing posts from December 24, 2018

魏孝庄帝

body.skin-minerva .mw-parser-output table.infobox caption{text-align:center} 魏孝莊帝 概要 姓名 元子攸 庙号 敬宗 谥号 孝莊皇帝 陵墓 静陵 政权 北魏 在世 507年-531年1月16日 在位 528年5月15日-531年1月6日 年号 建义:528年四月-九月 永安:528年九月-530年十二月 魏孝莊帝元子攸 (507年-531年1月26日),字 彦达 ,河南郡洛阳县(今河南省洛阳市东)人,魏献文帝拓跋弘之孙,彭城王元勰第三子,母親為王妃李媛華。孝莊帝是尔朱荣拥立的傀儡皇帝,最终被尔朱兆绞杀。 目录 1 生平 1.1 继位 1.2 刺杀尔朱荣 1.3 囚禁 1.4 被杀 2 皇后 3 參見 4 參考資料 5 外部連結 生平 元子攸姿貌很俊美,有勇力。自幼在宫为孝明帝元诩担任伴读,与魏孝明帝颇为友爱,官至中书侍郎,封武城县开国公,527年,被特封 长乐王 。 继位 528年5月15日(農曆四月十一日、建義元年),元子攸被尔朱荣拥立为皇帝。 刺杀尔朱荣 孝莊帝永安二年(529年)鑄永安五銖錢。九月二十五日(530年11月1日、永安三年),孝莊帝伏兵明光殿,聲稱皇后大尔朱氏生下了太子,派元徽向爾朱榮報喜。爾朱榮跟元天穆一起入朝。元子攸听说尔朱荣进宫臉色緊張,連忙喝酒以遮掩。尔朱荣见到光祿少卿魯安、典御李侃晞從東廂門执刀闖入,便撲向元子攸。元子攸用藏在膝下的刀砍到尔朱荣,魯安等揮刀亂砍,殺爾朱榮與元天穆等人。 囚禁 十月三十日(530年12月5日、永安三年),爾朱兆另立元曄為帝。十二月三日(531年1月6日),爾朱兆攻入洛陽,殺死孝莊帝在襁褓中的儿子,孝莊帝被俘囚於永寧寺、後解送囚於晉陽三級寺。 被杀 永安三年十二月甲子(531年1月26日),魏孝莊帝於晋阳城(今太原市晋源区境)三級寺被尔朱兆絞殺,虚岁二十四 [1] 。臨終前孝莊帝向佛祖禮拜,發願生生世世不做皇帝,並賦詩明志:「權去生道促,憂來死路長。懷恨出國門,含悲入鬼鄉。隧門一時閉

Detect collision with lines and limit movement

Image
1 I'm making a game with libGDX in Java. I'm trying to make a collision detection. As you can see in the image, I have a line which is a wall and a player with specified radius. The desired position is the next location which the player is trying to be in. But because there is a wall, he's placed in the Actual Position which is on the Velocity vector, but more closer to the prev location. I'm trying to figure out how can I detect that closer position? My attempt: private void move(float deltaTime) { float step; beginMovementAltitude(); if (playerComponent.isWalking()) step = handleAcceleration(playerComponent.getSpeed() + playerComponent.getAcceleration()); else step = handleDeacceleration(playerComponent.getSpeed(), playerComponent.getAcceleration()); playerComponen