Qt 5.13.0 (minExtend
and maxExtended
for QGeometry
)
Let's start series of simple Qt challenges in which we'll try to build often well known mini games or mechanisms by using our green framework.
#1 Qt task - Pong
In task number one the goal is to create Pong game. Probably all of you are familiar with this game in which two players are trying to get the point by buncing back the dot so that the opponent does not.
Requirements:
- Simple interface, built without using assets
- Counting and displaying points
- Steering for at least one player
This task is rather simple one, which has to be a kind of warmup. But if you need something more sophisticated - just free your imagination and tune pong game as you wish! Share your solution as a git link to start discussion about used Qt features and compare it to the others!
-
Couldn't use
onStarted
,onFinished
andonRunningChanged
signals in a nestedVector3dAnimation
inside of aTransition
. Solved by using aSequentialAnimation
combined with twoScriptAction
s at the beginning and end. -
Can't use
Camera
svoid translate(vLocal, enumeration option)
together withTransition
. This is why setting of the cameraposition
andviewCenter
is done manually. -
I had trouble using
KeyboardHandler
together withKeyboardDevice
in each of the differentScene
types I've created. Usingfocus
orenabled
wasn't work toggle each individual on and off. Once focused eachKeyboardHandler
received the same event even though it wasaccepted
. -
KeyboardHandler
onPressed
andonEscapePressed
will bothe be triggered even pressing the escape key even though it was accepted in theonPressed
call already.KeyboardHandler { id: keyboardHandler sourceDevice: keyboardDevice focus: true onPressed: { console.log("KeyboardHandler | onPressed") console.log("event " + event + " " + event.accepted) Logic.currentScene().onPressed(event) } onEscapePressed: { console.log("KeyboardHandler | onEscapePressed") console.log("event " + event + " " + event.accepted) Logic.currentScene().onEscapePressed(event) } }
Has strange side effects when used together with
FirstPersonCameraController
. The cameraposition
andviewCenter
will be set to a strange value, not set by the scene logic.
TODO: Hint about resetting code model Tools > QML/JS > Reset Code Model