readme.htm 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050
  1. <html xmlns:MSHelp="http://msdn.microsoft.com/mshelp" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:xanx="http://schemas.microsoft.com/developer/xanx/2005"><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"><META NAME="save" CONTENT="history">
  2. <title>Spacewar Starter Kit</title>
  3. <!-- v1.4 -->
  4. <style><!--
  5. /***********************************************************
  6. * SCRIPT-SUPPORTING STYLES
  7. ***********************************************************/
  8. /* Defines the userData cache persistence mechanism. */
  9. .userDataStyle
  10. {
  11. behavior: url(#default#userData);
  12. }
  13. /* Used to save the scroll bar position when navigating away from a page. */
  14. div.saveHistory
  15. {
  16. behavior: url(#default#saveHistory);
  17. }
  18. /* Formats the expand/collapse images for all collapsible regions. */
  19. img.toggle
  20. {
  21. border: 0;
  22. margin-right: 5;
  23. }
  24. /* Formats the Language filter drop-down image. */
  25. img#languageFilterImage
  26. {
  27. border: 0;
  28. margin-left: 0;
  29. vertical-align: middle;
  30. }
  31. /* Formats the Members Options filter drop-down image. */
  32. img#membersOptionsFilterImage
  33. {
  34. border: 0;
  35. margin-left: 0;
  36. vertical-align: middle;
  37. }
  38. /* Formats the Collapse All/Expand All images. */
  39. img#toggleAllImage
  40. {
  41. margin-left: 0;
  42. vertical-align: middle;
  43. }
  44. /* Supports XLinks */
  45. MSHelp\:link
  46. {
  47. text-decoration: underline;
  48. color: #0000ff;
  49. hoverColor: #3366ff;
  50. filterString: ;
  51. }
  52. body
  53. {
  54. background: #FFFFFF;
  55. color: #000000;
  56. font-family: Verdana;
  57. font-size: medium;
  58. font-style: normal;
  59. font-weight: normal;
  60. margin-top: 0;
  61. margin-bottom: 0;
  62. margin-left: 0;
  63. margin-right: 0;
  64. width: 100%;
  65. /*font-size: 110%;*/
  66. }
  67. div.toggle_section
  68. {
  69. margin-left: 15px;
  70. }
  71. div.h5
  72. {
  73. margin-left: 1.5em;
  74. }
  75. /* Font for all headings */
  76. h1, h2, h3, h4, h5, h6
  77. {
  78. font-family: Verdana, Arial, Helvetica, sans-serif;
  79. margin-top: 18;
  80. margin-bottom: 8;
  81. font-weight: bold;
  82. }
  83. h1
  84. {
  85. font-size: 130%;
  86. color: #003399;
  87. }
  88. div#scrollyes h1 /* Changes font size for full-scrolling topic */
  89. {
  90. font-size: 150%;
  91. }
  92. h2
  93. {
  94. font-size: 125%;
  95. }
  96. h3
  97. {
  98. font-size: 115%;
  99. margin-top: 9;
  100. margin-bottom: 4;
  101. }
  102. h4
  103. {
  104. font-size: 100%;
  105. margin-top: 9;
  106. margin-bottom: 4;
  107. }
  108. h4.subheading3
  109. {
  110. font-size: 10px;
  111. margin-left: 0em;
  112. }
  113. h5
  114. {
  115. font-size: 100%;
  116. margin-top: 9;
  117. margin-bottom: 4;
  118. }
  119. ul p, ol p, dl p
  120. {
  121. margin-left: 0em;
  122. }
  123. p
  124. {
  125. margin-top: .6em;
  126. margin-bottom: .6em;
  127. }
  128. td p
  129. {
  130. margin-top: 0.0em;
  131. margin-bottom: 0.6em;
  132. }
  133. dd p
  134. {
  135. margin-top: 0.0em;
  136. margin-bottom: 0.6em;
  137. }
  138. .image
  139. {
  140. text-align: center;
  141. }
  142. dl
  143. {
  144. margin-top: 0em;
  145. margin-bottom: 1.3em;
  146. }
  147. dd
  148. {
  149. margin-bottom: 0em;
  150. margin-left: 0;
  151. }
  152. dl.glossary dd
  153. {
  154. margin-bottom: 0em;
  155. margin-left: 1.5em;
  156. }
  157. dt
  158. {
  159. margin-top: .6em;
  160. margin-bottom: 1;
  161. }
  162. ul, ol
  163. {
  164. margin-top: 0.6em;
  165. margin-bottom: 0.6em;
  166. }
  167. ol
  168. {
  169. margin-left: 2.5em;
  170. }
  171. ul
  172. {
  173. list-style-type: disc;
  174. margin-left: 1.9em;
  175. }
  176. li
  177. {
  178. margin-bottom: 0.4em;
  179. }
  180. ul ol, ol ol
  181. {
  182. list-style-type: lower-alpha;
  183. }
  184. pre
  185. {
  186. margin-top: .6em;
  187. margin-bottom: .6em;
  188. }
  189. pre
  190. {
  191. font: 105% Lucida, mono;
  192. color: #000066;
  193. }
  194. code
  195. {
  196. font-family: Monospace, Courier New, Courier;
  197. font-size: 105%;
  198. color: #000066;
  199. }
  200. table.userdata td
  201. {
  202. background: #ffffff;
  203. background-color: #F5F5F5;
  204. border-color: #ffffff;
  205. border: none;
  206. }
  207. table.clsWarning
  208. {
  209. background: #ffffff;
  210. padding: 0px;
  211. margin: 0px;
  212. border: none;
  213. }
  214. table.clsWarning td
  215. {
  216. padding: 0px;
  217. margin: 0px;
  218. background: #ffffff;
  219. vertical-align: middle;
  220. font-size: 70%;
  221. }
  222. div#mainSection table
  223. {
  224. width: 98%;
  225. background: #ffffff;
  226. margin-top: 5px;
  227. margin-bottom: 5px;
  228. }
  229. div#mainSection table th
  230. {
  231. padding: 5px 6px;
  232. background: #EFEFF7;
  233. text-align: left;
  234. font-size: 70%;
  235. vertical-align: bottom;
  236. border-bottom: 1px solid #C8CDDE;
  237. }
  238. div#mainSection table td
  239. {
  240. padding: 5px 5px;
  241. background: #F7F7FF;
  242. vertical-align: top;
  243. font-size: 70%;
  244. border-bottom: 1px solid #D5D5D3;
  245. }
  246. div#mainSection table.syntax th
  247. {
  248. padding: 1px 6px;
  249. color: #000066;
  250. }
  251. div#mainSection table.syntax td
  252. {
  253. padding: 1px 5px;
  254. }
  255. /* Applies to the running header text in the first row of the upper table in the
  256. non-scrolling header region. */
  257. span#runningHeaderText
  258. {
  259. color: #003399;
  260. font-size: 90%;
  261. padding-left: 13;
  262. }
  263. /* Applies to the topic title in the second row of the upper table in the
  264. non-scrolling header region. */
  265. span#nsrTitle
  266. {
  267. color: #003399;
  268. font-size: 120%;
  269. font-weight: 600;
  270. padding-left: 13;
  271. }
  272. /* Applies to everything below the non-scrolling header region. */
  273. div#mainSection
  274. {
  275. font-size: 70%;
  276. width: 100%;
  277. }
  278. /* Applies to everything below the non-scrolling header region, minus the footer. */
  279. div#mainBody
  280. {
  281. font-size: 90%;
  282. margin-left: 15;
  283. margin-top: 10;
  284. padding-bottom: 20;
  285. }
  286. /* Adds right padding for all blocks in mainBody */
  287. div#mainBody p, div#mainBody ol, div#mainBody ul, div#mainBody dl
  288. {
  289. padding-right: 5;
  290. }
  291. div#mainBody div.alert, div#mainBody div.code, div#mainBody div.tableSection
  292. {
  293. width:98.9%;
  294. }
  295. div.alert p, div.code p
  296. {
  297. margin-top:5;
  298. margin-bottom:8;
  299. }
  300. /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Begin Note Styles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
  301. div#mainSection div.alert table
  302. {
  303. border: 0;
  304. }
  305. div#mainSection div.alert table th
  306. {
  307. padding-top: 0;
  308. padding-bottom: 0;
  309. padding-left: 5;
  310. padding-right: 5;
  311. }
  312. div#mainSection div.alert table td
  313. {
  314. padding-left: 5;
  315. padding-right: 5;
  316. }
  317. img.note
  318. {
  319. border: 0;
  320. margin-left: 0;
  321. margin-right: 3;
  322. }
  323. /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - End Note Styles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
  324. /*- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Begin Non-scrolling Header Region Styles - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -*/
  325. /* Applies to the entire non-scrolling header region. */
  326. div#header
  327. {
  328. background-color: #D4DFFF;
  329. padding-top: 0;
  330. padding-bottom: 0;
  331. padding-left: 0;
  332. padding-right: 0;
  333. width: 100%;
  334. }
  335. /* Applies to both tables in the non-scrolling header region. */
  336. div#header table
  337. {
  338. margin-top: 0;
  339. margin-bottom: 0;
  340. border-bottom-color: #C8CDDE;
  341. border-bottom-style: solid;
  342. border-bottom-width: 1;
  343. background: #D4DFFF;
  344. width: 100%;
  345. }
  346. /* Applies to cells in both tables in the non-scrolling header region. */
  347. div#header table td
  348. {
  349. color: #0000FF;
  350. font-size: 70%;
  351. padding-right: 20;
  352. padding-top: 1;
  353. padding-bottom: 1;
  354. border: none;
  355. background: #D4DFFF;
  356. }
  357. /* Applies to the last row in the upper table of the non-scrolling header region. Text
  358. in this row includes See Also, Constructors, Methods, and Properties. */
  359. div#header table tr#headerTableRow3 td
  360. {
  361. padding-bottom: 2;
  362. padding-top: 5;
  363. padding-left: 15;
  364. }
  365. /* Applies to the lower table in the non-scrolling header region. Text in this table
  366. includes Collapse All/Expand All, Language Filter, and Members Options. */
  367. div#header table#bottomTable
  368. {
  369. border-top-color: #FFFFFF;
  370. border-top-style: solid;
  371. border-top-width: 1;
  372. text-align: left;
  373. padding-left: 15;
  374. }
  375. blockquote
  376. {
  377. margin-left: 3.8em;
  378. margin-right: 3.8em;
  379. margin-top: .6em;
  380. margin-bottom: .6em;
  381. }
  382. sup
  383. {
  384. text-decoration: none;
  385. font-size: smaller;
  386. }
  387. a:link
  388. {
  389. color: #0000FF;
  390. /* font-weight: bold */
  391. }
  392. a:visited
  393. {
  394. color: #0000AA;
  395. /* font-weight: bold */
  396. }
  397. a:hover
  398. {
  399. color: #3366FF;
  400. /* font-weight: bold */
  401. }
  402. .label
  403. {
  404. font-weight: bold;
  405. margin-top: 1em;
  406. margin-left: -26px;
  407. }
  408. .tl
  409. {
  410. margin-bottom: .75em;
  411. }
  412. .atl
  413. {
  414. padding-left: 1.5em;
  415. padding-bottom: .75em;
  416. }
  417. .cfe
  418. {
  419. font-weight: bold;
  420. }
  421. .mini
  422. {
  423. font-size: smaller;
  424. }
  425. .dt
  426. {
  427. margin-bottom: -.6em;
  428. }
  429. .indent
  430. {
  431. margin-left: 1.9em;
  432. margin-right: 1.9em;
  433. }
  434. .product
  435. {
  436. text-align: right;
  437. color: #333333;
  438. font-size: smaller;
  439. font-style: italic;
  440. }
  441. .buttonbarshade
  442. {
  443. position: relative;
  444. margin: 0;
  445. left: 0px;
  446. top: 2;
  447. width: 50%;
  448. height: 40px;
  449. }
  450. .buttonbartable
  451. {
  452. position: absolute;
  453. margin: 0;
  454. padding:0;
  455. border:0;
  456. left:0px;
  457. top: 2;
  458. width: 100%;
  459. height: 40px;
  460. }
  461. /* background color, font for header */
  462. table.buttonbartable td, table.buttonbarshade td
  463. {
  464. background: #ffffff; /*#5177B8; #80C615;*/
  465. border-left: 0px solid #80C615;
  466. margin: 0;
  467. padding: 0px 0px 0px 0px;
  468. font-family: Impact, sans-serif;
  469. font-size: 14pt;
  470. }
  471. table.buttonbartable td.button1
  472. {
  473. background: #5177B8; /*#80C615;*/;
  474. padding: 0;
  475. font-weight: bold;
  476. text-align: center;
  477. cursor: hand;
  478. }
  479. table.buttonbartable td.button2
  480. {
  481. background: #5177B8; /*#80C615;*/;
  482. font-weight: bold;
  483. text-align: center;
  484. }
  485. table.buttonbartable td.button3
  486. {
  487. background: #5177B8; /*#80C615;*/;
  488. font-weight: bold;
  489. text-align: center;
  490. }
  491. table.buttonbartable td.runninghead
  492. {
  493. padding-left: 0px;
  494. font-style: italic;
  495. text-align: left;
  496. }
  497. .version
  498. {
  499. text-align: left;
  500. color: #000000;
  501. margin-top: 3em;
  502. margin-left: -26px;
  503. font-size: smaller;
  504. font-style: italic;
  505. }
  506. .lang, .ilang
  507. {
  508. color: #0000ff;
  509. font: normal 7pt Arial, Helvetica, sans-serif;
  510. }
  511. div.langMenu
  512. {
  513. position: absolute;
  514. z-index: 1;
  515. width: 96pt;
  516. padding: 8pt;
  517. visibility: hidden;
  518. border: 1px solid #000000;
  519. background: #ffffd0;
  520. }
  521. div.langMenu ul
  522. {
  523. padding-left: 2em;
  524. margin-left: 0;
  525. }
  526. div.filtered
  527. {
  528. margin: 4pt 0 8pt -26px;
  529. padding: 4px 4px 8px 26px;
  530. width: 100%;
  531. border: 2px solid #aaaacc;
  532. background: #ffffff;
  533. }
  534. div.filtered2
  535. {
  536. margin: 4pt 0 8pt -26px;
  537. padding: 4px 4px 8px 26px;
  538. width: 100%;
  539. border: none;
  540. background: #ffffff;
  541. }
  542. div.filtered h1, div.filtered h2, div.filtered h3, div.filtered h4
  543. {
  544. margin-left: -22px;
  545. }
  546. div.filtered span.lang
  547. {
  548. position: relative;
  549. left: -22px;
  550. }
  551. div.reftip
  552. {
  553. position: absolute;
  554. z-index: 1;
  555. padding: 8pt;
  556. visibility: hidden;
  557. border: 1px solid #000000;
  558. background: #ffffd0;
  559. }
  560. pre.syntax
  561. {
  562. background: #dddddd;
  563. color: #000000;
  564. padding: 2pt,4pt;
  565. margin-top:1.0em;
  566. cursor: text;
  567. }
  568. pre.syntax_nojs
  569. {
  570. background: #dddddd;
  571. color: #000000;
  572. padding: 2pt,4pt;
  573. cursor: text;
  574. }
  575. a.synParam
  576. {
  577. color: #0000FF;
  578. /*color: #3F7800;*/
  579. /*color: #8DC54F;*/
  580. text-decoration: none;
  581. font-weight: normal;
  582. }
  583. a.synParam:hover
  584. {
  585. text-decoration: underline;
  586. font-weight: normal;
  587. }
  588. div.sapop
  589. {
  590. position: absolute;
  591. z-index: 1;
  592. left: 26px;
  593. width: 100%;
  594. padding: 10px 10px 10px 36px;
  595. visibility: hidden;
  596. border: 1px solid #000000;
  597. background: #ffffd0;
  598. }
  599. div.footer
  600. {
  601. width: 100%;
  602. border: none;
  603. background: #ffffff;
  604. margin-top: 18pt;
  605. padding-bottom: 12pt;
  606. color: #0000FF;
  607. /*color: #228B22; */
  608. text-align: center;
  609. font-size: 76%;
  610. }
  611. div.preliminary
  612. {
  613. margin-top: 8pt;
  614. padding-bottom: 12pt;
  615. color: #A0A0A0;
  616. }
  617. /* A procedure section. eg. 'To create a file', 'To add a value' */
  618. div.proc
  619. {
  620. margin-left: 0.5em;
  621. }
  622. /* The title of a 'procedure' section. */
  623. div.proch
  624. {
  625. font-family: Verdana, Arial, Helvetica, sans-serif;
  626. font-weight: bold;
  627. font-size: 115%;
  628. margin-top: 1em;
  629. margin-bottom: 0.4em;
  630. margin-left: -0.5em;
  631. color: #003399;
  632. }
  633. div.proc ul
  634. {
  635. margin-left: 1.5em;
  636. }
  637. div.proc ol
  638. {
  639. margin-left: 2.0em;
  640. }
  641. .note
  642. {
  643. margin-left: 14pt;
  644. margin-right: 12pt;
  645. }
  646. .indent1
  647. {
  648. margin-left: 12pt;
  649. }
  650. .indent2
  651. {
  652. margin-left: 24pt;
  653. }
  654. .indent3
  655. {
  656. margin-left: 36pt;
  657. }
  658. p.proch
  659. {
  660. padding-left: 16px;
  661. }
  662. p.proch img
  663. {
  664. position: relative;
  665. vertical-align: top;
  666. left: -18px;
  667. margin-right: -14px;
  668. margin-bottom: -18px;
  669. }
  670. div.clsPlatSpec
  671. {
  672. background-color:#FFF8DC;
  673. border-style:solid;
  674. border-width:1pt 0pt 0pt 1pt;
  675. border-color:#ffE4C4;
  676. margin-top:0.6em;
  677. width:100%;
  678. }
  679. /* Applies to the language labels in the Language Filter drop-down list. */
  680. .languageFilter
  681. {
  682. color: #0000FF;
  683. cursor:hand;
  684. text-decoration:underline;
  685. padding-bottom:4;
  686. }
  687. /* Dropdown areas */
  688. #languageSpan {
  689. position: absolute;
  690. visibility: hidden;
  691. border-style: solid;
  692. border-width: 1px;
  693. border-color: #C8CDDE;
  694. background: #d4dfff;
  695. padding: 4px;
  696. font-size: 70%;
  697. }
  698. #membersOptionsSpan {
  699. position: absolute;
  700. visibility: hidden;
  701. border-style: solid;
  702. border-width: 1px;
  703. border-color: #C8CDDE;
  704. background: #d4dfff;
  705. padding: 4px;
  706. font-size: 70%;
  707. }
  708. --></style>
  709. </head><body><div id="mainSection"><div id="mainBody">
  710. <h1>Spacewar Starter Kit</h1>
  711. <p>This topic contains the following sections.</p>
  712. <ul><li><a href="#ID0EP">Introduction</a></li><li><a href="#ID0ELB">Goals</a></li><li><a href="#ID0EAC">Getting Started</a></li><li><a href="#extending">Extending Spacewar</a></li></ul>
  713. <h1><a name="ID0EP"></a>Introduction</h1><div id="ID0EP" class="h1">
  714. <p>This Microsoft&reg; XNA&trade; Game Studio 2.0 Spacewar Starter Kit is a complete starship combat game. The project comes ready to compile and run, and is easy to customize with only a little extra C# programming. The <a href="#extending">Extending Spacewar</a> section contains a list of some customizations you might make. You are also free to use the source code as the basis for your own XNA Game Studio game projects, and to share your work with others.</p>
  715. <p>Spacewar is provided in XNA Game Studio 2.0 for your enjoyment and modification. The game comes in two versions: Retro and Evolved. The Retro version is inspired by the first implementation of Spacewar, developed by Stephen Russell, Peter Samson, and Dan Edwards in 1962 for the DEC PDP-1; the Evolved version features similar gameplay, but with 3D models and effects.</p>
  716. <div class="alert"><table cellspacing="0" cellpadding="0"><tr><th>Note </th></tr><tr><td>This documentation assumes that you have a basic knowledge of programming concepts and the Visual C# environment. You can learn more about these topics in the product documentation by clicking one of the <b>Help</b> menu items, or by positioning the mouse cursor on language keywords or user interface elements such as windows or dialog boxes, and then pressing the F1 key.</td></tr></table></div>
  717. </div>
  718. <h1><a name="ID0ELB"></a>Goals</h1><div id="ID0ELB" class="h1">
  719. <p>This starter kit provides a complete XNA Game Studio 2.0 game, including source code and game content such as 3D models, textures, and sounds. This starter kit documentation describes the Spacewar game, and then suggests interesting customizations you can make. The Spacewar starter kit demonstrates:</p>
  720. <ul>
  721. <li>XNA Framework, including the Application Model and Content Pipeline</li>
  722. <li>Game graphics, audio, and input</li>
  723. <li>Game concepts such as collision detection and the game loop</li>
  724. <li>C# Language</li>
  725. </ul>
  726. </div>
  727. <h1><a name="ID0EAC"></a>Getting Started</h1><div id="ID0EAC" class="h1">
  728. <h2><a name="ID0EEC"></a>Creating, Building, and Running a Spacewar Project</h2><div id="ID0EEC" class="h2">
  729. <p>You can create multiple Spacewar projects. Each is a complete, stand-alone game that you can build, run, and modify as desired.</p>
  730. <div class="proc">
  731. <div class="proch">To create a new Spacewar project</div>
  732. <ol>
  733. <li>On the <b>File</b> menu in your version of Visual Studio, click <b>New</b>, and then click <b>Project</b>.</li>
  734. <li>A dialog box will appear with a tree list on the left pane, marked Project Types. Select <b>XNA Game Studio 2.0</b> underneath the <b>Visual C#</b> node.</li>
  735. <li>A set of available projects will appear in the Templates pane. Select <b>Spacewar Xbox 360 Starter Kit (2.0)</b>, and then click <b>OK</b>.</li>
  736. </ol>
  737. <div class="alert"><table cellspacing="0" cellpadding="0"><tr><th>Note </th></tr><tr><td>The starter kit may take a minute or two to load.</td></tr></table></div>
  738. </div>
  739. <div class="proc">
  740. <div class="proch">To build and run the Spacewar project</div>
  741. <ol>
  742. <li>
  743. Press the F5 key or, on the <b>Debug</b> menu, click <b>Start Debugging</b>.
  744. </li>
  745. <p>The project will build and then run within the debugger.</p>
  746. </ol>
  747. <div class="alert"><table cellspacing="0" cellpadding="0"><tr><th>Note </th></tr><tr><td>
  748. The project may take several minutes to build before it can be launched. To see build progress during the build, display the output window (from the <b>View</b> menu, click <b>Output</b>) before starting the build.
  749. </td></tr></table></div>
  750. </div>
  751. <div class="proc">
  752. <div class="proch">To build the project without running it</div>
  753. <ol>
  754. <li>
  755. Press the F6 key or, on the <b>Build</b> menu, click <b>Build Solution</b>.
  756. </li>
  757. <p>The project will build without running.</p>
  758. </ol>
  759. </div>
  760. <p>
  761. When Spacewar starts, it displays the main screen where you can choose to play the <b>Retro</b> or <b>Evolved</b> versions of the game, or see controller <b>Info</b>.
  762. </p>
  763. </div>
  764. <h2><a name="ID0EKF"></a>Playing Spacewar</h2><div id="ID0EKF" class="h2">
  765. <p>Spacewar can be played by one or two players. Players first choose a ship type and color; then, the battle begins. The goal in Spacewar is to use your ship's weapon to destroy your opponent's ship, but beware! Your opponent's weapon is not the only threat: You must also avoid the gravitational pull of the sun or be destroyed!</p>
  766. <p>You score points by destroying your opponent. After each round of play, the cash you earned from annihilating your enemy can be used to buy new weapons for the next round.</p>
  767. <h3><a name="ID0ESF"></a>Spacewar Controls</h3><div id="ID0ESF" class="h3">
  768. <p>You can use a keyboard or Xbox 360 controller to play Spacewar. The controls are mapped as follows:</p>
  769. <table>
  770. <tr>
  771. <th>Action</th>
  772. <th>Controller</th>
  773. <th>Keyboard P1</th>
  774. <th>Keyboard P2</th>
  775. </tr>
  776. <tr>
  777. <td>Select ship type, color, and weapon</td>
  778. <td>D-pad</td>
  779. <td>A, D, W, S</td>
  780. <td>arrow keys or keypad arrows</td>
  781. </tr>
  782. <tr>
  783. <td>Fire weapon</td>
  784. <td>Right trigger or <b>A</b></td>
  785. <td>V</td>
  786. <td>keypad 7, keypad <b>.</b>, HOME, or DELETE</td>
  787. </tr>
  788. <tr>
  789. <td>Rotate ship, forward and reverse thrust</td>
  790. <td>Left thumbstick</td>
  791. <td>A, D, W, S</td>
  792. <td>arrow keys or keypad arrows</td>
  793. </tr>
  794. <tr>
  795. <td>Hyperspace warp</td>
  796. <td>Left trigger or <b>B</b></td>
  797. <td>G</td>
  798. <td>keypad 1, keypad 0, END, or INSERT</td>
  799. </tr>
  800. <tr>
  801. <td>Pause</td>
  802. <td>Back</td>
  803. <td>Left SHIFT</td>
  804. <td>Right SHIFT</td>
  805. </tr>
  806. </table>
  807. <br />
  808. <table>
  809. <tr>
  810. <th>Button</th>
  811. <th>Keyboard P1</th>
  812. <th>Keyboard P2</th>
  813. </tr>
  814. <tr>
  815. <td><b>A</b></td>
  816. <td>V</td>
  817. <td>HOME or keypad 7</td>
  818. </tr>
  819. <tr>
  820. <td><b>B</b></td>
  821. <td>G</td>
  822. <td>END or keypad 1</td>
  823. </tr>
  824. <tr>
  825. <td><b>X</b></td>
  826. <td>F</td>
  827. <td>PAGE UP or keypad 9</td>
  828. </tr>
  829. <tr>
  830. <td><b>Y</b></td>
  831. <td>T</td>
  832. <td>PAGE DOWN or keypad 3</td>
  833. </tr>
  834. </table>
  835. </div>
  836. </div>
  837. </div>
  838. <h1><a name="extending"></a>Extending Spacewar</h1><div id="extending" class="h1">
  839. <p>The Spacewar starter kit contains many models, textures, and sounds that you can experiment with to make changes to the graphics and audio in the game. From making a few small changes in Spacewar, to significantly altering gameplay and graphics, to creating your own game using some of Spacewar's content, algorithms, or sample code, how you use this starter kit is entirely up to you.</p>
  840. <p>Here a just a few examples of the types of changes you can make to Spacewar.</p>
  841. <ul>
  842. <li>
  843. <p>Create or modify 3D models.</p>
  844. <p>You can add new 3D models that you create, modify, or download. XNA Game Studio 2.0 accepts geometry and model data in the DirectX X file format (.x) and Autodesk FBX format (.fbx). Most 3D design tools will export to one of these two formats.</p>
  845. <p>For information about adding and using models, see the <b>Content Pipeline Overviews</b> and <b>3D Graphics</b> topics in the documentation.</p>
  846. </li>
  847. <li>
  848. <p>Create or modify textures.</p>
  849. <p>The textures associated with models can be changed. XNA Game Studio 2.0 supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga.</p>
  850. <p>For information about adding and using textures, see the <b>Content Pipeline Overviews</b> topic in the documentation.</p>
  851. </li>
  852. <li>
  853. <p>Create or modify shaders and effects.</p>
  854. <p>Spacewar comes with several effects, from the aptly named simple.fx to the more complex ship.fx. Shaders and effects are powerful ways to control and enhance the lighting, materials, and textures of your models. With a little bit of work and experimentation you can create truly amazing effects.</p>
  855. <p>For information about shaders and effects, see the <b>3D Graphics Overview</b> and <b>How to: Create and Apply Custom Effects</b> topics in the documentation.</p>
  856. </li>
  857. <li>Change ship performance: speed, rotation, and thrust.</li>
  858. <li>Change weapon characteristics: speed, damage, and reload time.</li>
  859. <li>Change game rules: earned money, turn length, and victory conditions.</li>
  860. <li>Without changing any code, you can modify the settings.xml file to change several game parameters including lighting, speed, gravity, thrust, as well as the keyboard mappings that the game uses.</li>
  861. <li>Make the Sun a "third player." When the Sun destroys your ship, the points go to the Sun rather than your opponent. Perhaps the Sun could win, or upgrade.</li>
  862. <li>Change the shaders used by the different models, for strange and unique effects.</li>
  863. </ul>
  864. <p>The <b>Getting Started with XNA Game Studio</b> section of the documentation contains some excellent walthroughs that show you how to use sprites, 3D graphics, models, textures, input, audio, and more.</p>
  865. <h2><a name="ID0E3CAC"></a>Example Change</h2><div id="ID0E3CAC" class="h2">
  866. <p>Here's an example modification that you can make to Spacewar.</p>
  867. <h3><a name="ID0ECDAC"></a>Rogue Asteroid!</h3><div id="ID0ECDAC" class="h3">
  868. <p>Make an asteroid available as one of the ship choices.</p>
  869. <ol>
  870. <li>
  871. <p>In the Evolved\EvolvedShape.cs file, change the p1_saucer ship mesh to the asteroid2 mesh:</p>
  872. <div id="syntaxCodeBlocks" class="code"><span codeLanguage="other"><table class="syntax"><tr><th>C# </th></tr><tr><td><pre>private static string[,] shipMesh = new string[,]
  873. {
  874. {
  875. @"models\p1_pencil",
  876. @"models\asteroid2", // @"models\p1_saucer",
  877. @"models\p1_wedge",
  878. },</pre></td></tr></table></span></div>
  879. </li>
  880. <li>
  881. <p>In the same file, change the texture used by that ship mesh (or you can keep the original ship texture for a truly evolved asteroid):</p>
  882. <div id="syntaxCodeBlocks" class="code"><span codeLanguage="other"><table class="syntax"><tr><th>C# </th></tr><tr><td><pre>private static string[,] shipDiffuse = new string[,]
  883. {
  884. {
  885. @"textures\pencil_p1_diff_v{0}",
  886. @"textures\asteroid2", // @"textures\saucer_p1_diff_v{0}",
  887. @"textures\wedge_p1_diff_v{0}",
  888. },</pre></td></tr></table></span></div>
  889. </li>
  890. </ol>
  891. <p>That's all there is to it. Player one's second ship choice (the saucer) is now rendered as an asteroid. These ship models and textures are loaded in EvolvedShape.Render using the <b>ContentManager.Load</b> method:</p>
  892. <div id="syntaxCodeBlocks" class="code"><span codeLanguage="other"><table class="syntax"><tr><th>C# </th></tr><tr><td><pre>model = SpacewarGame.ContentManager.Load&lt;Model&gt;(SpacewarGame.Settings.MediaPath + shipMesh[(int)player, shapeNumber]);
  893. texture = SpacewarGame.ContentManager.Load&lt;Texture2D&gt;(SpacewarGame.Settings.MediaPath + String.Format(shipDiffuse[(int)player, shapeNumber], (skinNumber + 1)));</pre></td></tr></table></span></div>
  894. <p>Some possible further Rogue Asteroid modifications:</p>
  895. <ul>
  896. <li>Change the 2D ship shown on the ship selector screen to match the asteroid. (You'll need to edit the textures\ship_select_FINAL.tga texture.)</li>
  897. <li>Change the rotation axis of the asteroid so that it rotates about its short axis instead of its long axis.</li>
  898. <li>Change the engine thrust offset, characteristics, or color. The Ship.cs file performs the engine thrust calculations and rendering (look at the <b>Update</b> and <b>Render</b> methods).</li>
  899. <li>Change the materials or effect used by the rogue asteroid.</li>
  900. <li>Change the weapon power and speed of the asteroid.</li>
  901. </ul>
  902. </div>
  903. <h3><a name="ID0E4EAC"></a></h3><div id="ID0E4EAC" class="h3">
  904. </div>
  905. </div>
  906. </div>
  907. </div></div></body></html>