Skip to content

Commit 894a9c5

Browse files
committed
Pong as slide show
1 parent b00d332 commit 894a9c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+109
-164
lines changed

usr/bin/calamares-biglinux

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/bin/bash
22

33
#Translation
4-
LANGUAGE=$LANG:en
54
export TEXTDOMAINDIR="/usr/share/locale"
65
export TEXTDOMAIN=calamares-biglinux
76

@@ -375,7 +374,7 @@ bigbashview -s 1100x600 -n calamares-biglinux -p calamares-biglinux -c transpare
375374
# Start calamares
376375
if [ -e "/tmp/start_calamares" ]; then
377376
cp -f /usr/share/biglinux/themes/biglinux/.config/kdeglobals /root/.config/kdeglobals
378-
sudo /usr/bin/calamares-manjaro
377+
sudo QT_QUICK_BACKEND=software /usr/bin/calamares-manjaro
379378

380379
#Calamares failed to install
381380
if [ "$(grep -w completion /root/.cache/calamares/session.log | grep -v bash-completion | rev | cut -d ":" -f1 | rev | sed 's/^[ \t]*//;s/[ \t]*$//')" != "succeeded" ];then

usr/share/calamares/branding/biglinux/branding.desc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ images:
2323
productWelcome: "big-welcome.svg"
2424

2525
slideshow: "show.qml"
26-
slideshowAPI: 2
26+
slideshowAPI: 1
2727

2828
style:
2929
SidebarBackground: "#31363b"
-166 KB
Binary file not shown.
-196 KB
Binary file not shown.
-139 KB
Binary file not shown.
-196 KB
Binary file not shown.
-170 KB
Binary file not shown.
-163 KB
Binary file not shown.
-161 KB
Binary file not shown.
-175 KB
Binary file not shown.
-162 KB
Binary file not shown.
-161 KB
Binary file not shown.
-153 KB
Binary file not shown.
-179 KB
Binary file not shown.
-226 KB
Binary file not shown.
-165 KB
Binary file not shown.
-206 KB
Binary file not shown.
-158 KB
Binary file not shown.
-199 KB
Binary file not shown.
-177 KB
Binary file not shown.
-193 KB
Binary file not shown.
-167 KB
Binary file not shown.
-180 KB
Binary file not shown.
-171 KB
Binary file not shown.
-163 KB
Binary file not shown.
-156 KB
Binary file not shown.
-180 KB
Binary file not shown.
-231 KB
Binary file not shown.
-170 KB
Binary file not shown.
-207 KB
Binary file not shown.
-157 KB
Binary file not shown.
-202 KB
Binary file not shown.
-172 KB
Binary file not shown.
-177 KB
Binary file not shown.
-165 KB
Binary file not shown.
-180 KB
Binary file not shown.
-170 KB
Binary file not shown.
-169 KB
Binary file not shown.
-157 KB
Binary file not shown.
-183 KB
Binary file not shown.
-228 KB
Binary file not shown.
Lines changed: 107 additions & 161 deletions
Original file line numberDiff line numberDiff line change
@@ -1,175 +1,121 @@
1-
import QtQuick 2.0;
2-
import calamares.slideshow 1.0;
1+
import QtQuick 2.15
2+
import QtQuick.Controls 2.15
3+
import QtQuick.Window 2.15
34

4-
Presentation
5-
{
6-
id: presentation
5+
Item {
6+
id: root
7+
visible: true
8+
antialiasing: false
79

8-
Timer {
9-
interval: 17000
10-
running: true
11-
repeat: true
12-
onTriggered: presentation.goToNextSlide()
13-
}
14-
Slide
15-
{
10+
Rectangle {
11+
id: gameArea
1612
anchors.fill: parent
17-
18-
Image {
19-
id: background
20-
source: "pt/00.jpg"
21-
anchors.fill: parent
22-
13+
color: "black"
14+
15+
property int leftScore: 0
16+
property int rightScore: 0
17+
property real speedFactor: 1.0
18+
19+
function resetBall() {
20+
ball.x = gameArea.width / 2 - ball.width / 2;
21+
ball.y = gameArea.height / 2 - ball.height / 2;
22+
ball.dx = 8; // Double the initial speed
23+
ball.dy = 8; // Double the initial speed
24+
gameArea.speedFactor = 1.0;
2325
}
24-
}
25-
Slide
26-
{
27-
anchors.fill: parent
2826

29-
Image {
30-
id: background1
31-
source: "pt/01.jpg"
32-
anchors.fill: parent
33-
27+
Text {
28+
id: scoreDisplay
29+
text: "Player: " + gameArea.leftScore + " - Computer: " + gameArea.rightScore
30+
anchors.top: parent.top
31+
anchors.horizontalCenter: parent.horizontalCenter
32+
color: "white"
33+
font.pixelSize: 24
3434
}
35-
}
36-
Slide
37-
{
38-
anchors.fill: parent
39-
40-
Image {
41-
id: background2
42-
source: "pt/02.jpg"
43-
anchors.fill: parent
44-
45-
}
46-
}
47-
Slide
48-
{
49-
anchors.fill: parent
5035

51-
Image {
52-
id: background3
53-
source: "pt/03.jpg"
54-
anchors.fill: parent
55-
36+
// Player paddle
37+
Rectangle {
38+
id: leftPaddle
39+
width: 20
40+
height: 100
41+
color: "white"
42+
x: 10
43+
y: gameArea.height / 2 - height / 2
5644
}
57-
}
58-
59-
Slide
60-
{
61-
anchors.fill: parent
62-
63-
Image {
64-
id: background4
65-
source: "pt/04.jpg"
66-
anchors.fill: parent
67-
68-
}
69-
}
70-
71-
72-
Slide
73-
{
74-
anchors.fill: parent
75-
76-
Image {
77-
id: background5
78-
source: "pt/05.jpg"
79-
anchors.fill: parent
80-
81-
}
82-
}
83-
84-
85-
Slide
86-
{
87-
anchors.fill: parent
88-
89-
Image {
90-
id: background6
91-
source: "pt/06.jpg"
92-
anchors.fill: parent
93-
94-
}
95-
}
96-
97-
98-
Slide
99-
{
100-
anchors.fill: parent
101-
102-
Image {
103-
id: background7
104-
source: "pt/07.jpg"
105-
anchors.fill: parent
106-
107-
}
108-
}
109-
110-
111-
Slide
112-
{
113-
anchors.fill: parent
114-
115-
Image {
116-
id: background8
117-
source: "pt/08.jpg"
118-
anchors.fill: parent
119-
120-
}
121-
}
122-
123-
124-
Slide
125-
{
126-
anchors.fill: parent
127-
128-
Image {
129-
id: background9
130-
source: "pt/09.jpg"
131-
anchors.fill: parent
132-
133-
}
134-
}
135-
136-
137-
Slide
138-
{
139-
anchors.fill: parent
140-
141-
Image {
142-
id: background10
143-
source: "pt/10.jpg"
144-
anchors.fill: parent
145-
146-
}
147-
}
148-
149-
150-
Slide
151-
{
152-
anchors.fill: parent
153-
154-
Image {
155-
id: background11
156-
source: "pt/11.jpg"
157-
anchors.fill: parent
158-
159-
}
160-
}
16145

46+
// Computer paddle
47+
Rectangle {
48+
id: rightPaddle
49+
width: 20
50+
height: 100
51+
color: "white"
52+
x: gameArea.width - width - 10
53+
y: gameArea.height / 2 - height / 2
54+
}
16255

163-
Slide
164-
{
165-
anchors.fill: parent
56+
// Ball
57+
Rectangle {
58+
id: ball
59+
width: 20
60+
height: 20
61+
color: "white"
62+
x: gameArea.width / 2 - width / 2
63+
y: gameArea.height / 2 - height / 2
64+
65+
property int dx: 8 // Double the initial speed
66+
property int dy: 8 // Double the initial speed
67+
68+
Timer {
69+
interval: 30 // Adjust as needed
70+
running: true
71+
repeat: true
72+
onTriggered: {
73+
// Move ball
74+
ball.x += ball.dx * gameArea.speedFactor;
75+
ball.y += ball.dy * gameArea.speedFactor;
76+
77+
// Ball collision with top and bottom
78+
if (ball.y <= 0 || ball.y >= gameArea.height - ball.height) {
79+
ball.dy *= -1;
80+
}
81+
82+
// Ball collision with paddles
83+
if (ball.x <= leftPaddle.x + leftPaddle.width && ball.y + ball.height >= leftPaddle.y && ball.y <= leftPaddle.y + leftPaddle.height) {
84+
ball.dx *= -1;
85+
gameArea.speedFactor *= 1.1; // Increase speed by 10%
86+
}
87+
if (ball.x + ball.width >= rightPaddle.x && ball.y + ball.height >= rightPaddle.y && ball.y <= rightPaddle.y + rightPaddle.height) {
88+
ball.dx *= -1;
89+
gameArea.speedFactor *= 1.1; // Increase speed by 10%
90+
}
91+
92+
// Ball out of bounds
93+
if (ball.x <= 0) {
94+
gameArea.rightScore += 1;
95+
gameArea.resetBall();
96+
} else if (ball.x >= gameArea.width - ball.width) {
97+
gameArea.leftScore += 1;
98+
gameArea.resetBall();
99+
}
100+
101+
// AI for right paddle
102+
// Increase the movement speed and improve logic
103+
if (ball.y < rightPaddle.y + rightPaddle.height / 2) {
104+
rightPaddle.y -= Math.min(12, rightPaddle.y - ball.y + rightPaddle.height / 2); // Faster and smarter reaction
105+
} else if (ball.y > rightPaddle.y + rightPaddle.height / 2) {
106+
rightPaddle.y += Math.min(12, ball.y - rightPaddle.y - rightPaddle.height / 2); // Faster and smarter reaction
107+
}
108+
}
109+
}
110+
}
166111

167-
Image {
168-
id: background12
169-
source: "pt/12.jpg"
112+
MouseArea {
113+
id: mouseArea
170114
anchors.fill: parent
171-
115+
hoverEnabled: true
116+
onPositionChanged: {
117+
leftPaddle.y = Math.max(0, Math.min(mouse.y - leftPaddle.height / 2, gameArea.height - leftPaddle.height));
118+
}
119+
}
172120
}
173-
}
174-
175121
}
-6.41 KB
Binary file not shown.

0 commit comments

Comments
 (0)