-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ef6b10f
commit ff7a60c
Showing
12 changed files
with
75 additions
and
30 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<tileset version="1.10" tiledversion="1.11.0" name="levelOne" tilewidth="16" tileheight="16" tilecount="242" columns="22"> | ||
<image source="tiles/levelOne.png" width="352" height="176"/> | ||
</tileset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<tileset version="1.10" tiledversion="1.11.0" name="levelOne" tilewidth="16" tileheight="16" tilecount="242" columns="22"> | ||
<image source="tiles/levelOne.png" width="352" height="176"/> | ||
</tileset> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,29 @@ | ||
import 'dart:async'; | ||
|
||
import 'package:flame/components.dart'; | ||
import 'package:flame/parallax.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
class BackgroundTile extends ParallaxComponent { | ||
final String color; | ||
BackgroundTile({ | ||
this.color = 'Gray', | ||
position, | ||
}) : super( | ||
position: position, | ||
); | ||
|
||
final double scrollSpeed = 10; | ||
final double scrollSpeed = 1; | ||
|
||
@override | ||
FutureOr<void> onLoad() async { | ||
priority = -1; | ||
size = Vector2.all(64); | ||
parallax = await game.loadParallax( | ||
[ParallaxImageData('Background/$color.png')], | ||
baseVelocity: Vector2(-scrollSpeed, 0), | ||
repeat: ImageRepeat.repeat, | ||
fill: LayerFill.none); | ||
[ | ||
ParallaxImageData('Background/new_sky.png'), // Use the new image | ||
], | ||
baseVelocity: | ||
Vector2(-scrollSpeed, 0), // Adjust scroll speed if necessary | ||
repeat: ImageRepeat.repeatX, // Only repeat horizontally | ||
fill: LayerFill.height, // Stretch to fill the screen height | ||
); | ||
return super.onLoad(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import 'dart:async'; | ||
import 'package:flame/components.dart'; | ||
import 'package:flame/parallax.dart'; | ||
import 'package:flutter/cupertino.dart'; | ||
|
||
class Clouds extends ParallaxComponent { | ||
Clouds({ | ||
position, | ||
}) : super( | ||
position: position, | ||
); | ||
|
||
final double cloudScrollSpeed = 10; // Adjust for desired cloud speed | ||
|
||
@override | ||
FutureOr<void> onLoad() async { | ||
priority = -1; | ||
parallax = await game.loadParallax( | ||
[ | ||
ParallaxImageData( | ||
'Background/clouds.png'), // Make sure you have a clouds image | ||
], | ||
baseVelocity: Vector2(-cloudScrollSpeed, 0), | ||
repeat: ImageRepeat.repeatX, | ||
fill: LayerFill.height, // Stretch to fill the screen height | ||
); | ||
return super.onLoad(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters