I am making a game. There are two characters in the game like ‘hero’ and ‘enemy’. I have made separate classes of them. Should I declare a new custom type for each character like
import QtQuick 1.1
import hero 1.0
Hero{
power:100
energy:100
image:”/src/hero.png”
}
or just use a regular element like
import QtQuick 1.1
Image{
source:hero.getImgSource() //method declared in hero class
}
So, I am in confusion to make a new element or just use the existing one and use the C++ bindings with QML. Is there any other approach to do so?
Thanks in advance…
↧