<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Blog d'un développeur multi-support &#187; jeux</title>
	<atom:link href="http://www.oni-ecchi.info/blog/tag/jeux/feed" rel="self" type="application/rss+xml" />
	<link>http://www.oni-ecchi.info/blog</link>
	<description>[DIM] pour les intimes :)</description>
	<lastBuildDate>Fri, 18 Jun 2010 06:27:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Slick en détail</title>
		<link>http://www.oni-ecchi.info/blog/decouverte-java/slick-en-detail.html</link>
		<comments>http://www.oni-ecchi.info/blog/decouverte-java/slick-en-detail.html#comments</comments>
		<pubDate>Sun, 25 Jan 2009 10:47:41 +0000</pubDate>
		<dc:creator>Guillaume chave</dc:creator>
				<category><![CDATA[Découverte Java]]></category>
		<category><![CDATA[exemple]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jeux]]></category>
		<category><![CDATA[jeux video]]></category>
		<category><![CDATA[slick]]></category>
		<category><![CDATA[tutoriel]]></category>

		<guid isPermaLink="false">http://www.oni-ecchi.info/blog/?p=148</guid>
		<description><![CDATA[Bonjour,
Cette semaine j&#8217;ai du rendre pour l&#8217;école des gobelins le jeux que j&#8217;ai fait avec un . Comme ce projet est fini, et que je ne pense pas que je vais en faire grand chose de mon coté, je vais vous en expliquer le fonctionnement. Peut être que ça vous sera utile.
I) Installation
L&#8217;installation de slick [...]]]></description>
			<content:encoded><![CDATA[<p>Bonjour,</p>
<p>Cette semaine j&#8217;ai du rendre pour l&#8217;école des gobelins le jeux que j&#8217;ai fait avec un <a class="shal" href=" http://www.oni-ecchi.info/blog/decouverte-java/framework-java-pour-le-jeux.html" title=" Framework Java pour le jeux">framework java</a>. Comme ce projet est fini, et que je ne pense pas que je vais en faire grand chose de mon coté, je vais vous en expliquer le fonctionnement. Peut être que ça vous sera utile.</p>
<h3>I) Installation</h3>
<p>L&#8217;installation de slick dans un projet eclipse  est assez déroutante pour un newbie JAVA (j&#8217;y ai passé une demi journée de cours ^^) même avec<a rel="nofollow" href="http://www.cs.bsu.edu/homepages/pvg/misc/slick_eclipse_tutorial.php" target="_blank"> un très bon (l&#8217;unique ?) tutoriel d&#8217;installation. </a>Faites bien attention au dernier point, c&#8217;est important.</p>
<p>En fait Slick est basé sur un autre framework nommée <a rel="nofollow" href="http://lwjgl.org/" target="_blank">lwgl</a>, il y a donc deux librairies pour le prix d&#8217;une. Vive la réutilisation ! Slick étant un framework dédié aux un jeux 2D, il fait le ménage dans lwgl des choses non indispensables et rajoute tout ce qui va bien pour la 2D.</p>
<p>Passons au code !</p>
<h3>II) Premier Exemple</h3>
<p>Je pars du principe que votre installation est fonctionnelle. Voici le code de mon premier test slick. Il s&#8217;agissait d&#8217;afficher une image, un test, et grâce au clavier de faire pivoter cette image. Le principe de base est le même pour le jeux final.</p>
<p>J&#8217;ai commenter tout le code pour vous expliquer pas à pas ce qu&#8217;il se passe.</p>

<div class="wp_codebox_msgheader wp_codebox_hide"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p148code7'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1487"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
</pre></td><td class="code" id="p148code7"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.newdawn.slick.BasicGame</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.newdawn.slick.GameContainer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.newdawn.slick.Graphics</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.newdawn.slick.Image</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.newdawn.slick.Input</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.newdawn.slick.SlickException</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.newdawn.slick.AppGameContainer</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">import</span> <span style="color: #006699;">org.newdawn.slick.util.Log</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">//Il faut étendre la classe BasicGame</span>
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">class</span> SimpleTest <span style="color: #000000; font-weight: bold;">extends</span> BasicGame <span style="color: #009900;">&#123;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// L'image tourne, il faut un petit angle non ?</span>
	<span style="color: #666666; font-style: italic;">// En fait il en faut un pour se souvenir d'un FPS à l'autre de combien il</span>
	<span style="color: #666666; font-style: italic;">// faut tourner l'image.</span>
	<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Ainteger+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Integer</span></a> angle_image <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">public</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aimage+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Image</span></a> imgToTurn<span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Il faut un constructeur de base.</span>
	<span style="color: #666666; font-style: italic;">// Vous noterez que toutes les erreurs seront catchés au moment de</span>
	<span style="color: #666666; font-style: italic;">// l'exécution. (c'est à dire, dans le main)</span>
	<span style="color: #000000; font-weight: bold;">public</span> SimpleTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SlickException <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// Initialise le nom de la fenetre ..</span>
		<span style="color: #000000; font-weight: bold;">super</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;SimpleTest&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #666666; font-style: italic;">// Très pratique pour débuger l'application. Remplace le</span>
		<span style="color: #666666; font-style: italic;">// System.out.println .. et plus si affinié</span>
		Log.<span style="color: #006633;">info</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;je viens d'être initialisé&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Initialise mes objets. Exécuté au lancement du jeux.</span>
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> init<span style="color: #009900;">&#40;</span>GameContainer container<span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">throws</span> SlickException <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// J'ai besoin d'une image.</span>
		imgToTurn <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Aimage+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Image</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ressources/images/woman.jpg&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Méthode appelé en boucle. C'est ici que l'on fait vivre nos objets</span>
	<span style="color: #666666; font-style: italic;">// &quot;non graphique&quot; comme la gestion des touches, de nos propriétés (comme</span>
	<span style="color: #666666; font-style: italic;">// angle) etc</span>
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> update<span style="color: #009900;">&#40;</span>GameContainer container, <span style="color: #000066; font-weight: bold;">int</span> delta<span style="color: #009900;">&#41;</span>
			<span style="color: #000000; font-weight: bold;">throws</span> SlickException <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Si on appuie sur la fleche Haut</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>container.<span style="color: #006633;">getInput</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">isKeyDown</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span>Input.<span style="color: #006633;">KEY_UP</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			angle_image<span style="color: #339933;">++;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #666666; font-style: italic;">// Si on appuie sur la fleche Bas</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>container.<span style="color: #006633;">getInput</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>.<span style="color: #006633;">isKeyDown</span><span style="color: #009900;">&#40;</span>Input.<span style="color: #006633;">KEY_DOWN</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			angle_image<span style="color: #339933;">--;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// On fait en sorte que notre angle &quot;tourne en rond&quot; ^^</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>angle_image <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>gt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">360</span><span style="color: #009900;">&#41;</span>
			angle_image <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #666666; font-style: italic;">// Méthode appelé en boucle. C'est ici qu'on gére l'affichage.</span>
	@Override
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000066; font-weight: bold;">void</span> render<span style="color: #009900;">&#40;</span>GameContainer container, <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Agraphics+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Graphics</span></a> g<span style="color: #009900;">&#41;</span>
			<span style="color: #000000; font-weight: bold;">throws</span> SlickException <span style="color: #009900;">&#123;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Affiche un hello world en x:0 et y:100</span>
		g.<span style="color: #006633;">drawString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Hello, Slick world!&quot;</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">100</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		g.<span style="color: #006633;">drawString</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;coucou&quot;</span>, <span style="color: #cc66cc;">0</span>, <span style="color: #cc66cc;">150</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Je fais tourner l'image</span>
		imgToTurn.<span style="color: #006633;">setRotation</span><span style="color: #009900;">&#40;</span>angle_image<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Et je la rajoute à ma fenetre</span>
		g.<span style="color: #006633;">drawImage</span><span style="color: #009900;">&#40;</span>imgToTurn, <span style="color: #cc66cc;">200</span>, <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">static</span> <span style="color: #000066; font-weight: bold;">void</span> main<span style="color: #009900;">&#40;</span><a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a><span style="color: #009900;">&#91;</span><span style="color: #009900;">&#93;</span> args<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// Démarre un jeux à partir de ma classe</span>
			AppGameContainer app <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> AppGameContainer<span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> SimpleTest<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			app.<span style="color: #006633;">setTargetFrameRate</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">500</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			app.<span style="color: #006633;">start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>SlickException e<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// Et c'est ici que je catch les erreurs de toutes mes méthodes.</span>
			e.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Wahou non ? on a fait un jeux à partir de 5 fonctions, dans l&#8217;ordre :</p>
<ol>
<li>constructeur() &#8211; Spécifie la fenetre de jeux (icone, intitulé de fenetre ..)</li>
<li>init()  &#8211; Initialise tout nos objets</li>
<li> update() &#8211; Gestion du clavier et mis à jours d&#8217;objet non graphique</li>
<li> render() &#8211; Gestion de l&#8217;affichage, c&#8217;est là qu&#8217;on affiche ou non des éléments graphiques (image, texte, animation, etc)</li>
<li>main() &#8211; Il faut bien un point d&#8217;entré non ? On peut aussi s&#8217;en servir comme point de récupération des erreurs.</li>
</ol>
<p>Bon ca casse pas trois pattes à un canard, mais en moins de 100 lignes de codes avec les commentaires on s&#8217;en sort plutôt pas mal non ?</p>
<table border="0" align="center">
<tbody>
<tr>
<td><a href="http://www.oni-ecchi.info/blog/wp-content/uploads/2009/01/2009-01-25_1349.png"><img class="aligncenter size-thumbnail wp-image-173" title="SimpleTest" src="http://www.oni-ecchi.info/blog/wp-content/uploads/2009/01/2009-01-25_1349-150x150.png" alt="SimpleTest" width="150" height="150" /></a></td>
<td><a href="http://www.oni-ecchi.info/blog/wp-content/uploads/2009/01/2009-01-25_1350.png"><img class="aligncenter size-thumbnail wp-image-174" title="SimpleTest-2" src="http://www.oni-ecchi.info/blog/wp-content/uploads/2009/01/2009-01-25_1350-150x150.png" alt="SimpleTest-2" width="150" height="150" /></a></td>
</tr>
</tbody>
</table>
<p><span id="more-148"></span></p>
<h3>III) Pour aller plus loin</h3>
<p>Vous avez vu comment créer une fenetre, l&#8217;animer, et utiliser les écouteurs de touches. A ce stade là, vous pouvez commencer à créer vos <a class="shal" href=" http://www.oni-ecchi.info/blog/decouverte-java/framework-java-pour-le-jeux.html" title=" Framework Java pour le jeux">jeux</a>. Mais ne partez pas sans connaitre une fonctionnalité vraiment sympa dans Slick, le support de <a rel="nofollow" href="http://www.mapeditor.org/screenshots.html" target="_blank">Tiled</a>.</p>
<p style="text-align: center;">Tiled est un générateur de carte en java comme vous pouvez le voir <a href="http://www.oni-ecchi.info/blog/wp-content/uploads/2008/12/collision_layer_example.png"><img class="size-medium wp-image-117 aligncenter" title="Editeur de carte Tiled" src="http://www.oni-ecchi.info/blog/wp-content/uploads/2008/12/collision_layer_example-300x200.png" alt="Editeur de carte Tiled" width="300" height="200" /></a></p>
<p style="text-align: left;">En fait, en créant une carte avec Tiled, vous avez la possibilité de définir des propriétés pour chaque case (appelé tile) et vous pouvez les lire en Java très simplement. Voici un extrait de ma fonction init() (souvenez vous, c&#8217;est là qu&#8217;on initialise tout le jeux). Action !</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p148code8'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1488"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
</pre></td><td class="code" id="p148code8"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Charge la map</span>
map <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> TiledMap<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ressources/level/lvl1.tmx&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Initialise mes différents vecteurs</span>
caseGagnante <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Avector+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Vector</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
blocked <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Avector+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Vector</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// build a collision map based on tile properties in the TileD map</span>
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> x <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> x <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>lt<span style="color: #339933;">;</span> map.<span style="color: #006633;">getWidth</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> x<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> y <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> y <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>lt<span style="color: #339933;">;</span> map.<span style="color: #006633;">getHeight</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> y<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000066; font-weight: bold;">int</span> tileID <span style="color: #339933;">=</span> map.<span style="color: #006633;">getTileId</span><span style="color: #009900;">&#40;</span>x, y, <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Hydratation du vecteur de Collision</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> value <span style="color: #339933;">=</span> map.<span style="color: #006633;">getTileProperty</span><span style="color: #009900;">&#40;</span>tileID, <span style="color: #0000ff;">&quot;blocked&quot;</span>, <span style="color: #0000ff;">&quot;false&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;true&quot;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>value<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			blocked.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apoint+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Point</span></a><span style="color: #009900;">&#40;</span>x, y<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Hydratation du vecteur de case Gagnante</span>
		<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Astring+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">String</span></a> value2 <span style="color: #339933;">=</span> map.<span style="color: #006633;">getTileProperty</span><span style="color: #009900;">&#40;</span>tileID, <span style="color: #0000ff;">&quot;winCase&quot;</span>, <span style="color: #0000ff;">&quot;false&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;true&quot;</span>.<span style="color: #006633;">equals</span><span style="color: #009900;">&#40;</span>value2 <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
				caseGagnante.<span style="color: #006633;">add</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apoint+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Point</span></a><span style="color: #009900;">&#40;</span>x, y<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #009900;">&#125;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Et voilà, vous avez deux beaux vecteur rempli de bonne choses que vous pourrez exploiter par la suite. Par exemple, pour savoir si la position où l&#8217;on veut allé est &laquo;&nbsp;blocked&nbsp;&raquo; :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p148code9'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p1489"><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code" id="p148code9"><pre class="java" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000066; font-weight: bold;">boolean</span> blocked<span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">float</span> x, <span style="color: #000066; font-weight: bold;">float</span> y<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">// Log.info((int)x+&quot;-&quot;+(int)y +&quot; bloquer ?&quot;);</span>
    <span style="color: #000000; font-weight: bold;">return</span> blocked.<span style="color: #006633;">contains</span><span style="color: #009900;">&#40;</span><span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apoint+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Point</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span> x, <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span> y<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Ou bien, autre façon pour savoir si on est sur une case gagnante c&#8217;est de parcourir le vecteur à la main :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p148code10'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p14810"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code" id="p148code10"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Test si on est sur une case Gagnante</span>
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> j <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> j <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>lt<span style="color: #339933;">;</span> caseGagnante.<span style="color: #006633;">size</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> j<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	<a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apoint+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Point</span></a> point <span style="color: #339933;">=</span> caseGagnante.<span style="color: #006633;">elementAt</span><span style="color: #009900;">&#40;</span>j<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span> point.<span style="color: #006633;">getX</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span> playerX <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;&amp;</span>amp<span style="color: #339933;">;</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span> point.<span style="color: #006633;">getY</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span> playerY<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			lvlComplete <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">true</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// que l'on aurait pu simplifier par</span>
lvlComplete  <span style="color: #339933;">=</span> caseGagnante.<span style="color: #006633;">contains</span><span style="color: #009900;">&#40;</span> <span style="color: #000000; font-weight: bold;">new</span> <a href="http://www.google.com/search?hl=en&amp;q=allinurl%3Apoint+java.sun.com&amp;btnI=I%27m%20Feeling%20Lucky"><span style="color: #003399;">Point</span></a><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span>playerX, <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span><span style="color: #009900;">&#41;</span> playerY<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<h3>IV) Autres éléments</h3>
<p>Vous avez vu que les images sont gérer de façon vraiment simple dans Slick (cf SimpleTest), et bien les sons c&#8217;est la même chose. Voyez par vous même :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p148code11'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p14811"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code" id="p148code11"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// On joue un son wav</span>
<span style="color: #000000; font-weight: bold;">try</span> <span style="color: #009900;">&#123;</span>
	Sound fireSound  <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Sound<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ressources/sound/rocket-Part1.wav&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	fireSound.<span style="color: #006633;">play</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span> <span style="color: #000000; font-weight: bold;">catch</span> <span style="color: #009900;">&#40;</span>SlickException e1<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// TODO Auto-generated catch block</span>
		e1.<span style="color: #006633;">printStackTrace</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Et il y a la classe Animation, qui permet à partir de plusieurs images de créer dynamiquement une animation type gif. Si votre personnage est définit sur plusieurs images, vous pouvez le faire courir très simplement :</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p148code12'); return false;">View Code</a> JAVA</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p14812"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code" id="p148code12"><pre class="java" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Charge la libraire graphique</span>
SpriteSheet sheet <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> SpriteSheet<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;ressources/images/sprites.png&quot;</span>,
<span style="color: #cc66cc;">32</span>, <span style="color: #cc66cc;">32</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// create the player sprite based on a set of sprites from the sheet</span>
<span style="color: #666666; font-style: italic;">// loaded above (tank tracks moving)</span>
Animation player <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Animation<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">int</span> frame <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> frame <span style="color: #339933;">&amp;</span>amp<span style="color: #339933;">;</span>lt<span style="color: #339933;">;</span> <span style="color: #cc66cc;">7</span><span style="color: #339933;">;</span> frame<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
	player.<span style="color: #006633;">addFrame</span><span style="color: #009900;">&#40;</span>sheet.<span style="color: #006633;">getSprite</span><span style="color: #009900;">&#40;</span>frame, <span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span>, <span style="color: #cc66cc;">150</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// 150 est la duré de l'animation en milliseconde</span>
<span style="color: #009900;">&#125;</span>
player.<span style="color: #006633;">setAutoUpdate</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Puis quand vous voulez jouer l'animation, dans la méthode update par exemple</span>
player.<span style="color: #006633;">update</span><span style="color: #009900;">&#40;</span>delta<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #666666; font-style: italic;">// delta représente un entier, la clé de la frame à afficher.</span></pre></td></tr></table></div>

<p>Voici d&#8217;autres éléments que je n&#8217;ai pas testé mais qui ont l&#8217;air bien :</p>
<ul>
<li>Il y a une classe Music qui a l&#8217;air sympa vu que l&#8217;on peut ajouter des écouteurs d&#8217;évènement sur la musique en cours..</li>
<li>Le pathFinding est aussi géré. Ça a l&#8217;air assez simple.</li>
<li>Un générateur de particule est intégré  O_o  J&#8217;aurais pu faire mes explosions avec ^^</li>
</ul>
<h3>V) Conclusion</h3>
<p>Voici mon projet éclipse au complet, libre à vous de vous en inspirer/copier/critiquer.</p>
<blockquote><p><a href="/blog/wp-content/uploads/2009/01/MyGames.zip">Mon jeux Slick</a></p>
</blockquote>
<p>Sinon mon jeux est bidon au passage. C&#8217;est un pauvre Tank qui doit se déplacer d&#8217;un point A à un point B sans se faire exploser par des tourelles, et y a 5 map (la flemme d&#8217;en générer plus avec Tiled). Voilà voilà.</p>
<p>Pour en revenir à Slick :</p>
<ul>
<li>c&#8217;est sympa</li>
<li>c&#8217;est simple</li>
<li>Y a une bonne documentation dans l&#8217;ensemble (en francais aussi  O_o)</li>
<li>faut essayer.</li>
</ul>
<p>Bonne journée</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oni-ecchi.info/blog/decouverte-java/slick-en-detail.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Framework Java pour le jeux</title>
		<link>http://www.oni-ecchi.info/blog/decouverte-java/framework-java-pour-le-jeux.html</link>
		<comments>http://www.oni-ecchi.info/blog/decouverte-java/framework-java-pour-le-jeux.html#comments</comments>
		<pubDate>Wed, 24 Dec 2008 09:59:11 +0000</pubDate>
		<dc:creator>Guillaume chave</dc:creator>
				<category><![CDATA[Découverte Java]]></category>
		<category><![CDATA[astuce]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[jeux]]></category>
		<category><![CDATA[jeux video]]></category>
		<category><![CDATA[slick]]></category>
		<category><![CDATA[vidéo]]></category>

		<guid isPermaLink="false">http://www.oni-ecchi.info/blog/?p=113</guid>
		<description><![CDATA[Introduction
Dans le cadre de ma formation &#171;&#160;développeur informatique multi-support&#160;&#187; on nous a demandé de créer un jeux en Java en 2D de type &#171;&#160;mario&#160;&#187; ou plutôt de modifier un jeux existant en vue d&#8217;apprendre par nous même le java et d&#8217;en voir un coté plus sexy que les habituelles programmes en ligne de commande.
Voici l&#8217;url [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>Dans le cadre de ma formation &laquo;&nbsp;développeur informatique multi-support&nbsp;&raquo; on nous a demandé de créer un jeux en Java en 2D de type &laquo;&nbsp;mario&nbsp;&raquo; ou plutôt de modifier un jeux existant en vue d&#8217;apprendre par nous même le java et d&#8217;en voir un coté plus sexy que les habituelles programmes en ligne de commande.</p>
<p>Voici l&#8217;url que l&#8217;on nous a donné : <a href="http://fivedots.coe.psu.ac.th/~ad/jg/ch062/index.html" target="_blank">http://fivedots.coe.psu.ac.th/~ad/jg/ch062/index.html</a>. Ce chapitre est un extrait du livre <em><span style="color: #cc3300;">Killer Game Programming in Java</span></em> présenté par son auteur sur le site <a href="http://fivedots.coe.psu.ac.th/~ad/jg">http://fivedots.coe.psu.ac.th/~ad/jg</a>. Sur ce dernier vous trouverez d&#8217;autres jeux et d&#8217;autres chapitres intéressant.</p>
<p>Seulement je n&#8217;ai pas pour habitude d&#8217;apprendre en traficotant des exemples de code. Je le faisais quand je débutais en programmation, mais maintenant je pense être capable d&#8217;apprendre par moi même et de partir sur une base propre. Comme un framework par exemple !!</p>
<h3>Les Frameworks Java</h3>
<p>L&#8217;idée d&#8217;utiliser un framework java et capitaliser le temps des cours en une expérience riche m&#8217;est venu en regardant l&#8217;écran de <a href="http://www.epivoila.com/" target="_blank">Clément Biron</a> et <a href="http://www.palleas.com">Romain pouclet</a> qui s&#8217;intéressaient tout deux aux frameworks &laquo;&nbsp;<a href="http://processing.org/" target="_blank">processing&nbsp;&raquo; </a>et à  <a href="http://www.interactivepulp.com/pulpcore/" target="_blank">&laquo;&nbsp;PulpCore&nbsp;&raquo;</a>. (Il faut toujours cité ses sources :))</p>
<p>Alors pour maximiser nos découvertes je suis parti dans la découverte d&#8217;un troisième framework nommé <a href="http://slick.cokeandcode.com/" target="_blank">Slick.</a> Voila un bref apercu de ces frameworks après une journé à les regarder.</p>
<h4>Processing</h4>
<p>En un mot : Enorme. Le couteau suisse par exellence, ce framework s&#8217;adresse à tout le monde :</p>
<p><cite class="aligncenter">&nbsp;&raquo; for people who want to program images, animation, and interactions. It is used by          students, artists, designers, researchers, and hobbyists for          learning, prototyping, and production.&nbsp;&raquo;</cite></p>
<p>Personnellement, j&#8217;ai été bluffé par Processing quand j&#8217;ai vu cette vidéo :</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="400" height="302" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://vimeo.com/moogaloop.swf?clip_id=1663988&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" /><embed type="application/x-shockwave-flash" width="400" height="302" src="http://vimeo.com/moogaloop.swf?clip_id=1663988&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=&amp;fullscreen=1" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p><a href="http://vimeo.com/1663988"></a><a href="http://bricktable.wordpress.com/about/what-is-roots/">http://bricktable.wordpress.com/about/what-is-roots/</a> Du java rapide O_o wahou !</p>
<p>Bien sur cela ne se limite pas qu&#8217;à ça :) Il y a quand même 6 livres qui sont sorties sur ce framework ! &laquo;&nbsp;Ça envoie du lourd&nbsp;&raquo; comme dirait certains :)</p>
<h4>Pulpcore</h4>
<p>Pulpcore je le vois plutôt comme un moyen d&#8217;embarquer du java dans des pages web de façon transparente et se rapproche plus de Flash. <a href="http://www.pulpgames.net/milpa/">Exemple ici </a>et <a href="http://www.pulpgames.net/scared/">un autre exemple là</a>.</p>
<p>Bien que jeune, ce framework  tant à se faire connaitre avec son slogan provocateurs &laquo;&nbsp;Applets are back&nbsp;&raquo; :)</p>
<h4>Slick</h4>
<p>A la base, on nous a demandé de faire un jeux. Processing étant quand même énorme, et pulcore un peu trop limitatif, il fallait que je trouve un framework &laquo;&nbsp;médiant&nbsp;&raquo;. Hors <a href="http://slick.cokeandcode.com/" target="_blank">Slick</a> se positionne exclusivement comme étant LE framework dédié aux jeux 2D en java.  Great !</p>
<p>En gros, il fournit tout ce qu&#8217;on a besoin pour un jeux : gestion du clavier, gestion des collisions, gestion des cartes via <a href="http://www.mapeditor.org/screenshots.html" target="_blank">Tiled</a></p>
<div id="attachment_117" class="wp-caption aligncenter" style="width: 310px"><a href="http://www.oni-ecchi.info/blog/wp-content/uploads/2008/12/collision_layer_example.png"><img class="size-medium wp-image-117" title="collision_layer_example" src="http://www.oni-ecchi.info/blog/wp-content/uploads/2008/12/collision_layer_example-300x200.png" alt="" width="300" height="200" /></a><p class="wp-caption-text">Tiled, Le Map editor supporté par Slick</p></div>
<p>Je reviendrais en détail sur ce framework en expliquant comment créer un jeux, ou du moins je mettrais le code source à disposition. Mais vous pouvez voir un exemple de code source ici : <a href="http://www.oni-ecchi.info/blog/wp-content/uploads/2008/12/scroller.java">Un tank se déplacement sur une carte avec gestions des collisions !</a></p>
<h3>Et vous ?</h3>
<p>Si on vous demandez de faire un jeux Java en 2D, vous partiriez sur quoi ?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.oni-ecchi.info/blog/decouverte-java/framework-java-pour-le-jeux.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
