Giter Club home page Giter Club logo

cs319-element-wars's People

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Forkers

umuthic

cs319-element-wars's Issues

CardGraphicCreator Class Coding

As you know, for user interface we need to code CardGraphicCreator class which simply creates a visual card on the screen. It takes a Card object and creates proper graphic for the card.

Bildiğiniz üzere kullanıcı arayüzü için bir tane CardGraphicCreator isimli bir class yazmamız gerekiyor. Bu class'ın yaptığı iş: Bir tane Card objesi alıyor ve bu Card objesine uygun bir graphic oluşturuyor.

Consider the following card information:

Mesela aşağıdaki kartı düşnürsek

name:skeleton
cost:3 air element
artwork:1.png
description:
type:
attack:4
defence:6

Firstly, we must put a background image which is specific to element (air in this case). Then we must put a layout image which is common in all character cards. Energy icons are added next. Then name, description, type and attakk-defence values must be added.

Öncelikle kartın enerji tipine özel bir arkaplan resmi koyuyoruz. Sonra basit bir layout ekliyoruz ve enerji ikonlarını kartın sağ üst köşesine koyuyoruz. Son olarak atak, defans, isim, tip ve açıklama bilgilerini ekliyoruz.

Below there is some information about card graphic. Some of them may be changed in the future so this situation should be considered.

Kart grafiğiyle ilgili bazı bilgiler aşağıda. Bu bilgiler ileride değilebileceği için, bu durum göz önüne alınarak kodlama yapılmalı.

Card Size: 600px - 900px
Artwork Image Size: 530px - 360px
One Energy Crystal Size: 48px - 48px
Text Font: Cambria Math Regular
Title Font Size: 42px
Type Font Size: 42px
Description Font Size: 30px
Attack-Defense Font Size:96px
Note: There is a 1px black stroke around all texts.

There are some pictures below, that will be used. Some of them can be changed but there will no problem since we don't change their size.

Aşağıda grafiği oluştururken kullanılacak bazı resimler var. Bunlar kullanılabilir denemek için.

Card Layout

Different Backgrounds for Characters Associated with Different Type of Energies



Energy Icons
air_energy
earth_energy
fire_energy
pure_energy
water_energy

After class creates the graphic, it should be like these: (Note: The image at the top is more correct)

Sonuç aşağıdaki kartlara benzer bir şey olmalı. Aşağıdaki kartta ufak tefek hatalar var, yukarıdaki daha doğru


Aşağıda bazı kaynaklar var yardımcı olabilecek:

http://stackoverflow.com/questions/2318020/merging-two-images
http://www.youtube.com/watch?v=9QZksBHFKZk

DeckImporter Class Coding

As you know, the game keeps user decks in external text files. The game should import these files and convert into Deck objects. Text files have .deck extension and contain card id's. The number in the first line (n) represent the number of cards in the deck, and following n lines represent card id's. For example: There are 12 cards in the deck and these 12 cards are listed under '12'

Oyun kullanıcı destelerini .deck uzantılı dosyalarda tutuyor. Gerektiğin bu desteleri oyuna aktarabilmemiz lazım. Bunu DeckImporter class'ı yazacak. import( String idOfDeck) fonksiyonu çağrıldığında decks/idOfDeck.deck dosyasını çekecek. Bu dosyanın ilk satırı, destenin kaç karttan oluştuğunu gösteriyor. Kalan satırlar ise kartların id'lerini gösteriyor. Örnek: 12 kartlık bir deste. Fonksiyon sonuç olarak bir Deck objesi dönecek.

12
2
2
2
89
89
75
123
27
3
5
6
6

What this class should do:

  • Fetch the text file. (If there is no file, throw a proper exception)
  • Parse the id numbers.
  • Fetch cards. (This part is already written (CardImporter Class), details are below)
  • Add cards to a newly created Deck object and return it.

Bu class'ın yapması gerekenler

  • Bir tane deck id'si gelecek bu class'a ve class onu disk'ten alacak. Eğer öyle bir dosya yoksa exception gönderecek.
  • Kartların id numalarını çekecek
  • Bu id numaralarına göre CardImporter class'ı yardımıyla Card objeleri oluşturucak.
  • Bunları bir Deck objesinin içine atıp return edecek.

How to use Deck, Card and CardImporter classes
Deck d = new Deck();
//Get card id's from deckId.deck file.
for each card id
    Card c = CardImporter.loadCard( cardId);
    d.add( c);
return d;

Extra: Write DeckExporter class which does opposite thing of what this class does.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.