Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
Game engine template
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Equipe-14
Game engine template
Commits
ed2ec792
Commit
ed2ec792
authored
1 year ago
by
bosskkev
Browse files
Options
Downloads
Patches
Plain Diff
Correction bug superposition
parent
4767ee5b
No related branches found
No related tags found
No related merge requests found
Pipeline
#22751
failed
1 year ago
Stage: build
Stage: test
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/main/java/engine/Grid.java
+2
-4
2 additions, 4 deletions
src/main/java/engine/Grid.java
src/main/java/engine/ImageComponent.java
+1
-1
1 addition, 1 deletion
src/main/java/engine/ImageComponent.java
src/main/java/pong/PongApp.java
+2
-0
2 additions, 0 deletions
src/main/java/pong/PongApp.java
with
5 additions
and
5 deletions
src/main/java/engine/Grid.java
+
2
−
4
View file @
ed2ec792
...
@@ -24,16 +24,14 @@ public class Grid extends JFrame {
...
@@ -24,16 +24,14 @@ public class Grid extends JFrame {
// this.setContentPane(mainPanel);
// this.setContentPane(mainPanel);
this
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
this
.
setDefaultCloseOperation
(
JFrame
.
EXIT_ON_CLOSE
);
this
.
setLocationRelativeTo
(
null
);
this
.
setLocationRelativeTo
(
null
);
this
.
pack
();
this
.
setResizable
(
false
);
this
.
setResizable
(
false
);
this
.
setVisible
(
true
);
this
.
setVisible
(
true
);
this
.
setLayout
(
this
.
getLayout
());
kernel
.
start
();
kernel
.
start
();
kernel
.
setKeysListeners
((
JPanel
)
getContentPane
());
kernel
.
setKeysListeners
((
JPanel
)
getContentPane
());
this
.
pack
();
this
.
revalidate
();
this
.
revalidate
();
}
}
public
void
draw
(
ImageComponent
ic
)
throws
IOException
{
public
void
draw
(
ImageComponent
ic
)
throws
IOException
{
getContentPane
().
add
(
ic
);
getContentPane
().
add
(
ic
);
...
...
This diff is collapsed.
Click to expand it.
src/main/java/engine/ImageComponent.java
+
1
−
1
View file @
ed2ec792
...
@@ -16,7 +16,7 @@ public class ImageComponent extends JComponent {
...
@@ -16,7 +16,7 @@ public class ImageComponent extends JComponent {
this
.
image
=
image
;
this
.
image
=
image
;
this
.
position
=
position
;
this
.
position
=
position
;
//this.setBorder(BorderFactory.createLineBorder(Color.black));
//this.setBorder(BorderFactory.createLineBorder(Color.black));
this
.
setSize
(
width
,
height
);
this
.
setSize
(
850
,
500
);
this
.
setVisible
(
true
);
this
.
setVisible
(
true
);
this
.
setLayout
(
null
);
this
.
setLayout
(
null
);
//repaint();
//repaint();
...
...
This diff is collapsed.
Click to expand it.
src/main/java/pong/PongApp.java
+
2
−
0
View file @
ed2ec792
...
@@ -20,9 +20,11 @@ public class PongApp {
...
@@ -20,9 +20,11 @@ public class PongApp {
// TODO: Add rackets
// TODO: Add rackets
PongBall
pongBall
=
new
PongBall
(
"Ball"
,
"src/main/resources/sprint2_demo/asteroid.png"
,
new
Coordinates2D
(
10
,
10
),
64
,
64
);
PongBall
pongBall
=
new
PongBall
(
"Ball"
,
"src/main/resources/sprint2_demo/asteroid.png"
,
new
Coordinates2D
(
10
,
10
),
64
,
64
);
PongBall
pongBall2
=
new
PongBall
(
"Ball2"
,
"src/main/resources/sprint2_demo/asteroid.png"
,
new
Coordinates2D
(
40
,
40
),
64
,
64
);
PongBall
pongBall2
=
new
PongBall
(
"Ball2"
,
"src/main/resources/sprint2_demo/asteroid.png"
,
new
Coordinates2D
(
40
,
40
),
64
,
64
);
PongBall
pongBall3
=
new
PongBall
(
"Ball3"
,
"src/main/resources/sprint2_demo/asteroid.png"
,
new
Coordinates2D
(
70
,
70
),
64
,
64
);
components
.
add
(
pongBall
);
components
.
add
(
pongBall
);
components
.
add
(
pongBall2
);
components
.
add
(
pongBall2
);
components
.
add
(
pongBall3
);
Grid
grid
=
new
Grid
();
// Will create a new grid and a new kernel
Grid
grid
=
new
Grid
();
// Will create a new grid and a new kernel
grid
.
init
(
"Pong"
,
850
,
500
);
// Will start the kernel and set the keys listeners
grid
.
init
(
"Pong"
,
850
,
500
);
// Will start the kernel and set the keys listeners
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment