<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Cambiare lo stage (scena) in flash]]></title><description><![CDATA[<p dir="auto">Sono di nuovo io, questo è il listato del codice con il quale muovo una jeep (ship) con fari annessi, spara proiettili(il codice è in un altro fotogramma), quando colpisce una "buca" appare del fumo sul coffano etc. etc. Giorni fa' ho chiesto un consiglio su come cambiare scena, in un batibaleno mi è stata data la risposta che considero corretta( quella contrassegnata dall'icona) ma nonostante mille variazioni, la jeep se ne va tranquillamente olte lo stage senza cambiare niente. potete aiutarmi??<br />
spero di ricevere una risposta altrettanto veloce come la volta scorsa.</p>
<p dir="auto">onClipEvent(load) {<br />
//_root.startLevel();<br />
for(i=0;i&lt;5;i++){<br />
// DUPLICA LE BUCHE<br />
_root.buca.duplicateMovieClip("buca"+i,i);<br />
// GLI DA' UNA POSIZIONE CASUALE<br />
_root["buca"+i]._x = int(Math.random()*550);<br />
_root["buca"+i]._y = int(Math.random()*400);</p>
<pre><code>// DICHIARA LE VARIABILI
thrust = 3; //SLITTAMENTO LATERALE
decay = .12;
maxSpeed = 6;
</code></pre>
<p dir="auto">}<br />
}</p>
<p dir="auto">onClipEvent (enterFrame) {</p>
<pre><code>//SENZA QUESTA STRINGA I PROIETTILI RIMANGONO FERMI IMPORTANTISSIMO!!
_root.bulletsMove();
// CONTROLLA LE COLLISIONI
_root.checkHits();
//COLLISIONI TRA MOONBUGGY E LE FOSSE

//CREA UN "CICLO"
for(i=1;i&lt;25;i++)
//controlla se la jeep colpisce la buca 
if (_root["buca"+i].hitTest(_root["ship"])) {

//AZIONE QUANDO C'E LA COLLISIONE
_root.ship.gotoAndPlay("fumo2"); 
</code></pre>
<p dir="auto">}</p>
<p dir="auto"><img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/f71a0c43-865f-4388-9868-8b387eebeeb1-mmmm.gif?v=12b9555a9a1" class="not-responsive emoji emoji-customizations emoji--mmm" style="height:1.4em;width:auto;vertical-align:middle" title=":?" alt="" />  for(i=0;i&lt;25;i++)<br />
<img src="https://dev.connect.gt/assets/plugins/nodebb-plugin-emoji/emoji/customizations/f71a0c43-865f-4388-9868-8b387eebeeb1-mmmm.gif?v=12b9555a9a1" class="not-responsive emoji emoji-customizations emoji--mmm" style="height:1.4em;width:auto;vertical-align:middle" title=":?" alt="" /> if (_root["ship"._x] &lt;= 0); { gotoAndStop(Scena2);<br />
}<br />
//DICE: CON QUESTO CLIP(SHIP) COLLEGA IL CLIP FAR E FALLO MUOVERE INSIEME<br />
with (_root.fari) {<br />
_x = this._x+3;<br />
_y = this._y+3;<br />
_rotation = this._rotation+90;<br />
}</p>
<pre><code>// rotate right or left
if (Key.isDown(Key.RIGHT)) {
	_rotation += 10;
	
}
if (Key.isDown(Key.LEFT)) {
	_rotation -= 10;
	
}

if (Key.isDown(Key.UP)) {
	// calculate speed and trajectory based on rotation
	xSpeed += thrust*Math.sin(_rotation*(Math.PI/180));
	ySpeed += thrust*Math.cos(_rotation*(Math.PI/180));
	
} 


////SENZA DI QUESTE STRINGHE IL MOONBUGGY SI MUOVE E NON SI FERMA PIU'
else {
	xSpeed *= decay;
	ySpeed *= decay;
</code></pre>
<p dir="auto">}</p>
<pre><code>// MANTIENE LA STESSA VELOCITA' ALTRIMENTI SCHIZZA VIA 
speed = Math.sqrt((xSpeed*xSpeed)+(ySpeed*ySpeed));
if (speed&gt;maxSpeed) {
	xSpeed *= maxSpeed/speed;
	ySpeed *= maxSpeed/speed;
}
// muove il moonbuggy nella direzione scelta
_y -= ySpeed;
_x += xSpeed;
</code></pre>
<p dir="auto">}</p>
]]></description><link>https://dev.connect.gt/topic/1037/cambiare-lo-stage-scena-in-flash</link><generator>RSS for Node</generator><lastBuildDate>Fri, 27 Nov 2026 05:40:48 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/1037.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 09 May 2005 13:25:56 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Cambiare lo stage (scena) in flash on Tue, 10 May 2005 05:28:44 GMT]]></title><description><![CDATA[<p dir="auto">Speriamo che ora funzioni. Il libro che dici forse è "Programmare Flash 5 con Action Script" di Gary Rosenzweig. Molto bello pratico e con tantissimo codice. L'ho acquistato  l'anno scorso.</p>
]]></description><link>https://dev.connect.gt/post/252100</link><guid isPermaLink="true">https://dev.connect.gt/post/252100</guid><dc:creator><![CDATA[a.carter]]></dc:creator><pubDate>Tue, 10 May 2005 05:28:44 GMT</pubDate></item></channel></rss>