|
|||||||
|
|
|
![]() |
|
|
Strumenti |
|
|
#1 |
|
Senior Member
Iscritto dal: Jul 2002
Città: Reggio Calabria -> London
Messaggi: 12112
|
[Morphing Gem] - Double Fist of the North Star in Pair
Come da titolo io e Cisc applicheremo le tecniche della Sacra suola di Nanto e della Divina scuola di Hokuto per estrarre questa Morphing Gem
__________________
|
|
|
|
|
|
#2 |
|
Senior Member
Iscritto dal: Nov 2002
Città: Cosenza --> Roma
Messaggi: 853
|
allora, una lista di comportamenti da testare:
- una Stone al frame 5 deve diventare una MorphingGem - una MorphingGem deve avanzare i frame in modo da completare l'animazione - una MorphingGem deve trasformarsi in una Gem arrivata al frame 7 Tiger dimmi se ti viene in mente altro, se no possiamo cominciare
__________________
GNU MyServer Wants YOU!! We live thinking we will never die. We die thinking we had never lived. Jason Becker |
|
|
|
|
|
#3 |
|
Senior Member
Iscritto dal: Oct 2007
Città: Padova
Messaggi: 4131
|
Chi dei due sarà il successore della Divina Scuola di Refactor... ehm, di Hokuto?
![]() Ciao e buon divertimento! |
|
|
|
|
|
#4 |
|
Senior Member
Iscritto dal: Jul 2002
Città: Reggio Calabria -> London
Messaggi: 12112
|
ecco il primo test:
Codice:
package it.diamonds.tests.droppable.gems;
import static it.diamonds.droppable.DroppableColor.DIAMOND;
import it.diamonds.droppable.Droppable;
import it.diamonds.droppable.DroppableFactory;
import it.diamonds.tests.EnvironmentTestCase;
public class TestMorphingGem extends EnvironmentTestCase
{
public void testStoneBecomesMorphingGem()
{
DroppableFactory gemFactory = new DroppableFactory(environment);
Droppable stone = gemFactory.createStone(DIAMOND);
stone.getAnimatedSprite().setCurrentFrame(4);
stone.update(Stone.ANIMATION_FRAME_DELAY);
stone = stone.transform();
assertTrue(stone instanceof MorphingGem);
}
}
__________________
Ultima modifica di ^TiGeRShArK^ : 01-03-2008 alle 15:24. |
|
|
|
|
|
#5 |
|
Senior Member
Iscritto dal: Nov 2002
Città: Cosenza --> Roma
Messaggi: 853
|
il test postato da tiger comporta ancora modifiche troppo sostanziali, prima diamo coscienza a GemFactory che esistono le MorphingGem, ecco come si modifica testGemFactory:
Codice:
package it.diamonds.tests.droppable.gems;
import static it.diamonds.droppable.DroppableColor.DIAMOND;
import static it.diamonds.droppable.DroppableColor.EMERALD;
import static it.diamonds.droppable.DroppableColor.NO_COLOR;
import static it.diamonds.droppable.DroppableColor.RUBY;
import static it.diamonds.droppable.DroppableColor.SAPPHIRE;
import static it.diamonds.droppable.DroppableColor.TOPAZ;
import static it.diamonds.droppable.types.AbstractDroppableType.CHEST;
import static it.diamonds.droppable.types.AbstractDroppableType.FLASHING_GEM;
import static it.diamonds.droppable.types.AbstractDroppableType.GEM;
import static it.diamonds.droppable.types.AbstractDroppableType.MORPHING_GEM;
import it.diamonds.droppable.Droppable;
import it.diamonds.droppable.DroppableFactory;
import it.diamonds.tests.EnvironmentTestCase;
public class TestGemFactory extends EnvironmentTestCase
{
private DroppableFactory factory;
public void setUp()
{
super.setUp();
factory = new DroppableFactory(environment);
}
public void testGemCreation()
{
Droppable gem = factory.create(GEM, DIAMOND);
assertEquals("does not return a Gem", GEM, gem.getType());
assertEquals("does not return Gem of type diamond", DIAMOND, gem.getColor());
gem = factory.create(GEM, RUBY);
assertEquals("does not return a Gem", GEM, gem.getType());
assertEquals("does not return Gem of type ruby", RUBY, gem.getColor());
gem = factory.create(GEM, SAPPHIRE);
assertEquals("does not return a Gem", GEM, gem.getType());
assertEquals("does not return Gem of type sapphire", SAPPHIRE, gem.getColor());
gem = factory.create(GEM, EMERALD);
assertEquals("does not return a Gem", GEM, gem.getType());
assertEquals("does not return Gem of type emerald", EMERALD, gem.getColor());
gem = factory.create(GEM, TOPAZ);
assertEquals("does not return a Gem", GEM, gem.getType());
assertEquals("does not return Gem of type topaz", TOPAZ, gem.getColor());
}
public void testChestCreation()
{
Droppable gem = factory.create(CHEST, DIAMOND);
assertEquals("does not return a Chest", CHEST, gem.getType());
assertEquals("does not return Chest of type diamond", DIAMOND, gem.getColor());
gem = factory.create(CHEST, RUBY);
assertEquals("does not return a Chest", CHEST, gem.getType());
assertEquals("does not return Chest of type ruby", RUBY, gem.getColor());
gem = factory.create(CHEST, SAPPHIRE);
assertEquals("does not return a Chest", CHEST, gem.getType());
assertEquals("does not return Chest of type sapphire", SAPPHIRE, gem.getColor());
gem = factory.create(CHEST, EMERALD);
assertEquals("does not return a Chest", CHEST, gem.getType());
assertEquals("does not return Chest of type emerald", EMERALD, gem.getColor());
gem = factory.create(CHEST, TOPAZ);
assertEquals("does not return a Chest", CHEST, gem.getType());
assertEquals("does not return Chest of type topaz", TOPAZ, gem.getColor());
}
public void testFlashGemCreation()
{
Droppable gem = factory.create(FLASHING_GEM, NO_COLOR);
assertEquals("does not return Flashing gem of type diamond", FLASHING_GEM, gem.getType());
}
public void testCreateFlashingGem()
{
Droppable gem = factory.createFlashingGem();
assertEquals("does not return Gem of type topaz", FLASHING_GEM, gem.getType());
}
public void testFlashingGemFirstFrameDuration()
{
Droppable gem = factory.createFlashingGem();
assertEquals("Flashing gem first frame duration must be 0", 0, gem.getAnimatedSprite().getFrameDuration(0));
}
public void testFlashingGemAnimationLenght()
{
Droppable gem = factory.createFlashingGem();
assertEquals("Flashing gem animation lenght must be 8", 8, gem.getAnimatedSprite().getNumberOfFrames());
}
public void testCreateMorphingGem()
{
Droppable gem = factory.createMorphingGem();
assertEquals("does not return Gem of type topaz", MORPHING_GEM, gem.getType());
}
}
__________________
GNU MyServer Wants YOU!! We live thinking we will never die. We die thinking we had never lived. Jason Becker |
|
|
|
|
|
#6 |
|
Senior Member
Iscritto dal: Nov 2005
Messaggi: 1545
|
Scusate se mi intrometto a lavoro iniziato ma potete per favore separare il concetto di animation frame dal concetto di trasformazione?
|
|
|
|
|
|
#7 |
|
Senior Member
Iscritto dal: Jul 2002
Città: Reggio Calabria -> London
Messaggi: 12112
|
I test passano tutti ora..
Ma ho dovuto aggiungere ala mappa DROPPABLE_TYPENAMES la chiave MORPHING_GEM a cui ho associato il valore stones altrimenti non passava dato che la directory morphinggem non esiste. Procediamo tranquillamente così o creiamo dei nuovi files in cui mettere l'animazione delle morphing gems?
__________________
|
|
|
|
|
|
#8 | |
|
Senior Member
Iscritto dal: Jul 2002
Città: Reggio Calabria -> London
Messaggi: 12112
|
Quote:
__________________
|
|
|
|
|
|
|
#9 |
|
Senior Member
Iscritto dal: Jul 2002
Città: Reggio Calabria -> London
Messaggi: 12112
|
committato, anche il test commentato.
Wating for cisc return ..
__________________
|
|
|
|
|
|
#10 |
|
Senior Member
Iscritto dal: Nov 2005
Messaggi: 1545
|
al momento le stone per sapere a che stato si trova una trasformazione usano una cosa tipo:
if (getAnimation().getCurrentFrame() < 7) { //codice } Visto che vogliamo separare il rendering delle gemme dal loro stato interno bisogna levare questi pezzi di codice |
|
|
|
|
|
#11 | |
|
Senior Member
Iscritto dal: Jul 2002
Città: Reggio Calabria -> London
Messaggi: 12112
|
Quote:
__________________
|
|
|
|
|
|
|
#12 |
|
Senior Member
Iscritto dal: Oct 2002
Città: San Jose, California
Messaggi: 11794
|
Bene cosi'!
__________________
"We in the game industry are lucky enough to be able to create our visions" @ NVIDIA |
|
|
|
|
|
#13 |
|
Senior Member
Iscritto dal: Jul 2002
Città: Reggio Calabria -> London
Messaggi: 12112
|
..però mi sa che continuiamo domani
![]() prima è scappato cisc e poi io ..e ora sto uscendo.. ![]() Appuntamento a domani per quando mi sveglio
__________________
|
|
|
|
|
|
#14 |
|
Senior Member
Iscritto dal: Jul 2002
Città: Reggio Calabria -> London
Messaggi: 12112
|
dunque..
brevi considerazioni sull'indipendenza della trasformazione dal frame... discutendo con cisc ci siamo resi conto che per implementarlo allo stato attuale si dovrebbe comunque utilizzare un contatore che sia sostanzialmente equivalente al contatore utilizzato per i frames. E' vero che comunque sono due concetti diversi e che in futuro potrebbe cambiare la gestione del contatore delle animazioni dei frames... Ma quindi in questo caso è YAGNI o no?
__________________
|
|
|
|
|
|
#15 | |
|
Senior Member
Iscritto dal: Nov 2005
Messaggi: 1545
|
Quote:
|
|
|
|
|
|
|
#16 |
|
Senior Member
Iscritto dal: Oct 2002
Città: San Jose, California
Messaggi: 11794
|
__________________
"We in the game industry are lucky enough to be able to create our visions" @ NVIDIA |
|
|
|
|
|
#17 |
|
Senior Member
Iscritto dal: Nov 2005
Messaggi: 1545
|
Non e` questione di "in futuro vorremo cambiare la gestione" ma questione di correttezza. Non possiamo estrarre completamente il codice di rendering da droppable se non separiamo tutti questi concetti.
|
|
|
|
|
|
#18 |
|
Senior Member
Iscritto dal: Apr 2003
Città: Genova
Messaggi: 4739
|
il fatto è che se finora la logica interna alle stone si appoggiava al controllo del frame e funzionava, con l' introduzione della MorphingGem si può per ora riciclare tale logica per rimuoverla in seguito (è un task diverso)
__________________
Jappilas is a character created by a friend for his own comic - I feel honored he allowed me to bear his name Saber's true name belongs to myth - a Heroic Soul out of legends, fighting in our time to fullfill her only wish Let her image remind of her story, and of the emotions that flew from my heart when i assisted to her Fate
|
|
|
|
|
|
#19 |
|
Senior Member
Iscritto dal: Nov 2002
Città: Cosenza --> Roma
Messaggi: 853
|
ehm...ragazzi...con tiger abbiamo qualche problema a sincronizzarci
__________________
GNU MyServer Wants YOU!! We live thinking we will never die. We die thinking we had never lived. Jason Becker |
|
|
|
|
|
#20 | |
|
Senior Member
Iscritto dal: Jul 2002
Città: Reggio Calabria -> London
Messaggi: 12112
|
Quote:
Però oggi ci sono solo dopo le 23 mi sa..
__________________
|
|
|
|
|
|
| Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 17:11.























