Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

editing #6

Open
wants to merge 42 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
7832d18
First step!
ufrshubham Sep 6, 2021
e1e0caa
Parallax, Dino jump and animations
ufrshubham Sep 7, 2021
336548b
Added player data
ufrshubham Sep 8, 2021
3900e9f
Pause menu, health and score!
ufrshubham Sep 9, 2021
114c8a8
Main menu
ufrshubham Sep 9, 2021
4cbc6c7
Game over menu
ufrshubham Sep 10, 2021
33b7c9c
Bgm and Sfx
ufrshubham Sep 10, 2021
7445fb4
Comments and readme
ufrshubham Sep 10, 2021
7040a1e
Removed Enemy::onLoad()
ufrshubham Sep 11, 2021
969201c
Avoid duplicate entries in enemy data list
ufrshubham Sep 11, 2021
5153490
Added Discord link
ufrshubham Sep 11, 2021
01ea894
Fix hive init on web
ufrshubham Oct 20, 2021
01f65a6
Add `flutter_lints` package and fix linter offenses
karniv00l Dec 5, 2021
253c243
Merge pull request #3 from karniv00l/linter
ufrshubham Dec 5, 2021
ca4a5d5
Add spacing to menu buttons
karniv00l Dec 5, 2021
c19008e
Remove enemy based on its width
karniv00l Dec 5, 2021
876ac33
Merge pull request #4 from karniv00l/buttons-spacing
ufrshubham Dec 5, 2021
d74f704
Version up: Flame 1.0.0
ufrshubham Dec 9, 2021
47c6d1b
Add link to main branch
ufrshubham Dec 21, 2021
22ed88d
Fix Android embedding migration problem
ufrshubham Mar 1, 2022
df1aed5
Version-up: Flame 1.1.0
ufrshubham Mar 29, 2022
2f00d11
Fix hitbox position for dino and enemies
ufrshubham May 20, 2022
0c3ad93
Version-up: Flame-1.2.0
ufrshubham Jun 7, 2022
4d1bf99
Upgrade packages
ufrshubham Jul 18, 2022
0103507
Rename background music file
ufrshubham Jul 18, 2022
1ebf15c
Run workflow on rewrite branch as well
ufrshubham Jul 18, 2022
fdabc62
Upgrade packages
ufrshubham Aug 25, 2022
2404df9
Upgrade packages
ufrshubham Oct 1, 2022
0789c7d
Upgrade packages
ufrshubham Nov 29, 2022
9a97570
Upgrade to flame 1.6
ufrshubham Jan 15, 2023
b874a0e
Upgrade packages
ufrshubham Apr 6, 2023
71250ee
Update pubspec.yaml
ufrshubham Apr 7, 2023
6cd26a9
Upgrade to flame 1.8
ufrshubham May 30, 2023
d1e5531
Fix build workflow
ufrshubham Jun 1, 2023
c7e8ffb
Ignore deprecation warning
ufrshubham Jun 1, 2023
0c8452c
Upgrade packages
ufrshubham Aug 15, 2023
f07ba47
Upgrade to flame 1.10.0
ufrshubham Oct 13, 2023
2b9d62f
Upgrade packages and fix warnings
ufrshubham Jan 28, 2024
39c1c64
Upgrade to Flame 1.16.0
ufrshubham Feb 27, 2024
400859e
Upgrade packages and dart sdk
ufrshubham May 22, 2024
03fa85c
Upgrade gradle version (#5)
tarunchauhan97 May 22, 2024
202e7cb
editing
Flutter08 Jul 6, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 12 additions & 39 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,50 +1,23 @@
name: Dino Run CI

# This workflow is triggered on push and pull request to main branch.

name: Build
on:
push:
branches:
- main
- rewrite
pull_request:
branches:
- main
- rewrite

jobs:
build:
# This job will run on ubuntu virtual machine
runs-on: ubuntu-latest
runs-on: windows-latest
steps:

# Setup Java environment in order to build the Android app.
- uses: actions/checkout@v1
- uses: actions/setup-java@v1
with:
java-version: '12.x'

# Setup the flutter environment.
- uses: subosito/flutter-action@v1
with:
channel: 'stable' # 'dev', 'alpha', default to: 'stable'
# flutter-version: '1.12.x' # you can also specify exact version of flutter

# Get flutter dependencies.
- run: flutter pub get

# Check for any formatting issues in the code.
- run: flutter format --set-exit-if-changed .

# Statically analyze the Dart code for any errors.
- run: flutter analyze .

# Run widget tests for our flutter project. Nothing to run right now.
# - run: flutter test

# Build apk.
- run: flutter build apk

# Upload generated apk to the artifacts.
- uses: actions/upload-artifact@v1
with:
name: dino-run-demo-apk
path: build/app/outputs/apk/release/app-release.apk
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: subosito/flutter-action@v2
- run: dart format --set-exit-if-changed .
- run: flutter analyze .
- run: flutter config --enable-windows-desktop
- run: flutter build windows
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,5 @@ doc/api/
# secrets
secrets/
debugInfo/
key.property
key.property
debugInfo/
39 changes: 37 additions & 2 deletions .metadata
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,42 @@
# This file should be version controlled and should not be manually edited.

version:
revision: 1aafb3a8b9b0c36241c5f5b34ee914770f015818
channel: stable
revision: "761747bfc538b5af34aa0d3fac380f1bc331ec49"
channel: "stable"

project_type: app

# Tracks metadata for the flutter migrate command
migration:
platforms:
- platform: root
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: android
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: ios
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: linux
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: macos
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: web
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
- platform: windows
create_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49
base_revision: 761747bfc538b5af34aa0d3fac380f1bc331ec49

# User provided section

# List of Local paths (relative to this file) that should be
# ignored by the migrate tool.
#
# Files that are not part of the templates will be ignored by default.
unmanaged_files:
- 'lib/main.dart'
- 'ios/Runner.xcodeproj/project.pbxproj'
25 changes: 25 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "dino_run_shubm",
"request": "launch",
"type": "dart"
},
{
"name": "dino_run_shubm (profile mode)",
"request": "launch",
"type": "dart",
"flutterMode": "profile"
},
{
"name": "dino_run_shubm (release mode)",
"request": "launch",
"type": "dart",
"flutterMode": "release"
}
]
}
99 changes: 43 additions & 56 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,64 +1,22 @@
<div align="center" id="top">
<img src="./assets/images/DinoSprites_tard.gif" alt="Dino Run" width=64 height=64/>
# Dino Run

&#xa0;
A 2D infinite side scroller made using [Flame](https://flame-engine.org/) engine.

<!-- <a href="https://dino_run.netlify.app">Demo</a> -->
</div>
## Demo

<h1 align="center">Dino Run</h1>
![Menu](branding/menu.gif)

<p align="center">
<img alt="Github top language" src="https://img.shields.io/github/languages/top/ufrshubham/dino_run?color=7745b7">
![Jump](branding/jump.gif)

<img alt="Github language count" src="https://img.shields.io/github/languages/count/ufrshubham/dino_run?color=7745b7">
![Hit](branding/hit.gif)

<img alt="Repository size" src="https://img.shields.io/github/repo-size/ufrshubham/dino_run?color=7745b7">
## Downloads

<img alt="License" src="https://img.shields.io/github/license/ufrshubham/dino_run?color=7745b7">
- [Google Play](https://play.google.com/store/apps/details?id=com.nobs.dino_run)

<img alt="Github issues" src="https://img.shields.io/github/issues/ufrshubham/dino_run?color=7745b7" />
- [Itch.io](https://ufrshubham.itch.io/dino-run)

<img alt="Github forks" src="https://img.shields.io/github/forks/ufrshubham/dino_run?color=7745b7" />

<img alt="Github stars" src="https://img.shields.io/github/stars/ufrshubham/dino_run?color=7745b7" />
</p>

<!-- Status -->

<h4 align="center">
🚧 Dino_run 🚀 Under construction... 🚧
</h4>

<hr>

<p align="center">
<a href="#dart-about">About</a> &#xa0; | &#xa0;
<a href="#rocket-technologies">Technologies</a> &#xa0; | &#xa0;
<a href="#white_check_mark-requirements">Requirements</a> &#xa0; | &#xa0;
<a href="#checkered_flag-starting">Starting</a> &#xa0; | &#xa0;
<a href="#memo-license">License</a> &#xa0; | &#xa0;
<a href="https://github.com/ufrshubham" target="_blank">Author</a>
</p>

<br>

## :dart: About ##

Dino Run is a 2D infinite side scroller mobile game made in Flutter. This game is made using flame package, an awesome 2D game engine for flutter.

## :rocket: Technologies ##

The following tools were used in this project:

- [Flutter](https://flutter.dev/)
- [Flame](https://flame-engine.org/)

## :white_check_mark: Requirements ##

Before starting :checkered_flag:, you need to have [Git](https://git-scm.com) and [Flutter](https://flutter.dev/) installed.

## :checkered_flag: Starting ##
## Build steps

```bash
# Clone this project
Expand All @@ -76,15 +34,44 @@ $ flutter run
# The will start the game on any connected device.
```

## :memo: License ##
## Supported platforms

- Android
- iOS
- Windows (without audio)

## License

Assets provided in this repo are not owned by my. For more details about their origin and authors, check [assets/images/readme.md](assets/images/readme.md) and [assets/audio/readme.md](assets/audio/readme.md)

This project is under license from MIT. For more details, see the [LICENSE](LICENSE) file.

## Why the code is so different than the YouTube series?

Dino run is a simple mobile game that I originally started making, so that I can learn Flame engine. But while doing so, I couldn't find a lot of up-to date resources (apart of the official docs). So I decided to make a [YouTube series](https://www.youtube.com/playlist?list=PLiZZKL9HLmWOmQgYxWHuOHOWsUUlhCCOY) covering the development of this game.

Everything went great and in about 7 weeks I wrapped up the series (actual game completed way sooner than the series). The original game and the YouTube series was made using version 0.28 of Flame (probably latest at that time). But little did I know that Flame was under massive development preparing for the 1.0 release.

I suspected that my videos were going to get outdated pretty soon with newer versions of Flame. My plan to deal with this was to keep updating this repository with latest changes from Flame, so that new viewers of the series don't get stuck with a code that won't even build. But things got much worst after Flutter went null-safe. I tried migrating this project to null-safety and latest version of Flame multiple times. But I always ended up introducing a lot of bugs in the game.

It was not like this is a very big project and a lot of people are follow it. I was easier to leave this repository in a broken state. But personally, I've been through the frustration of trying to learn something new, spending hours and hours watching some tutorial series only to find out at the end that it is completely outdated. Remaking the whole YouTube series is a big undertaking (which I am not prepared for). But rewriting this game again wasn't that big of a deal. So finally I decided to rewrite the whole thing from scratch (almost), keeping the original code on a separate branch. Surprising it took me only few hours to get it up and running.

To check the original code, checkout the [main](https://github.com/ufrshubham/dino_run/tree/main) branch.

## Games inspired from Dino Run

This list might not contain all the project that are inspired from Dino Run, but these are the ones that I know of. If you want to add your game here or know of a game that should be featured here, feel free to open a pull request or send me the required details.

- [Fly Dash](https://play.google.com/store/apps/details?id=io.madhank93.dashy_bird&hl=en_IN) by [Madhan Kumaravelu](https://github.com/madhank93)

- [Warrior Runner](https://play.google.com/store/apps/details?id=hashim4498.games.warrior_runner&hl=en_IN) by [Mohammed Hashim](https://github.com/mohammedhashim44)

- [DinoRun](https://github.com/DetainedDeveloper/DinoRun) by [Jay](https://github.com/DetainedDeveloper)

- [run-dino-run](https://github.com/NextFaze/run-dino-run) by [Rushi Patel](https://github.com/whimzyLive)

Made with :brain: by <a href="https://github.com/ufrshubham" target="_blank">Ryuzki</a>
- [Dino Running](https://play.google.com/store/apps/details?id=rteixeira.apps.dino_run) by [Renan Teixeira](https://github.com/renant)

&#xa0;
___

<a href="#top">Back to top</a>
Join my [Discord](https://discord.gg/xHu3aUQGsJ) if you want to discuss something about this project.
29 changes: 29 additions & 0 deletions analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# This file configures the analyzer, which statically analyzes Dart code to
# check for errors, warnings, and lints.
#
# The issues identified by the analyzer are surfaced in the UI of Dart-enabled
# IDEs (https://dart.dev/tools#ides-and-editors). The analyzer can also be
# invoked from the command line by running `flutter analyze`.

# The following line activates a set of recommended lints for Flutter apps,
# packages, and plugins designed to encourage good coding practices.
include: package:flutter_lints/flutter.yaml

linter:
# The lint rules applied to this project can be customized in the
# section below to disable rules from the `package:flutter_lints/flutter.yaml`
# included above or to enable additional rules. A list of all available lints
# and their documentation is published at
# https://dart-lang.github.io/linter/lints/index.html.
#
# Instead of disabling a lint rule for the entire project in the
# section below, it can also be suppressed for a single line of code
# or a specific dart file by using the `// ignore: name_of_lint` and
# `// ignore_for_file: name_of_lint` syntax on the line or in the file
# producing the lint.
rules:
# avoid_print: false # Uncomment to disable the `avoid_print` rule
# prefer_single_quotes: true # Uncomment to enable the `prefer_single_quotes` rule

# Additional information about this file can be found at
# https://dart.dev/guides/language/analysis-options
2 changes: 2 additions & 0 deletions android/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
key.properties
**/*.keystore
**/*.jks
61 changes: 28 additions & 33 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,63 +1,58 @@
plugins {
id "com.android.application"
id "kotlin-android"
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
id "dev.flutter.flutter-gradle-plugin"
}

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
def localPropertiesFile = rootProject.file("local.properties")
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localPropertiesFile.withReader("UTF-8") { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
def flutterVersionCode = localProperties.getProperty("flutter.versionCode")
if (flutterVersionCode == null) {
flutterVersionCode = '1'
flutterVersionCode = "1"
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
def flutterVersionName = localProperties.getProperty("flutter.versionName")
if (flutterVersionName == null) {
flutterVersionName = '1.0'
flutterVersionName = "1.0"
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 29
namespace = "com.example.dino_run"
compileSdk = flutter.compileSdkVersion
ndkVersion = flutter.ndkVersion

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
disable 'InvalidPackage'
compileOptions {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.dino_run"
minSdkVersion 16
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
applicationId = "com.example.dino_run"
// You can update the following values to match your application needs.
// For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-gradle-build-configuration.
minSdk = flutter.minSdkVersion
targetSdk = flutter.targetSdkVersion
versionCode = flutterVersionCode.toInteger()
versionName = flutterVersionName
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.debug
signingConfig = signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
source = "../.."
}
Loading