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

Develop #654

Merged
merged 32 commits into from
Oct 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
44a579c
utility fixes
pieryvdl Oct 16, 2024
5ed6e3b
added validation to edit profile and a max length to the username inp…
MonikaTheiss Oct 17, 2024
9962557
Merge pull request #648 from COS301-SE-2024/feat/editValidation
MonikaTheiss Oct 17, 2024
64629a3
added multiple api keys to code and fixed username error via delay on…
pieryvdl Oct 17, 2024
727116a
updated workflow code with rawg keys
pieryvdl Oct 17, 2024
00dda87
updated readme
pieryvdl Oct 17, 2024
85df18d
basic email verification added. Just need to finalize what happens on…
MonikaTheiss Oct 17, 2024
8a3231c
disabled user from being able to rotate their screen ( feedback on us…
MonikaTheiss Oct 17, 2024
8aed20a
updated wiki again
pieryvdl Oct 17, 2024
5280eae
updated readme
pieryvdl Oct 17, 2024
ef2fa54
more readme updates
pieryvdl Oct 17, 2024
9eb6e33
readme update
pieryvdl Oct 17, 2024
fc36674
readme update
pieryvdl Oct 17, 2024
e249f4b
update readme again
pieryvdl Oct 17, 2024
7efcbc8
update to team member view
pieryvdl Oct 17, 2024
2ec844b
more updates to team members
pieryvdl Oct 17, 2024
8f1d73d
more readme updates
pieryvdl Oct 17, 2024
5137002
updated lerato
pieryvdl Oct 17, 2024
6fb065d
readme enhancements
pieryvdl Oct 17, 2024
3f263d4
readme enhancements
pieryvdl Oct 17, 2024
74c3231
readme fixes
pieryvdl Oct 17, 2024
b169ea7
added links
pieryvdl Oct 17, 2024
9afbdde
added email and bullets
pieryvdl Oct 18, 2024
a2f7564
made a table
pieryvdl Oct 18, 2024
a09ad53
Merge pull request #650 from COS301-SE-2024/fix/username
pieryvdl Oct 18, 2024
42b172c
hotfix to add advertisements
pieryvdl Oct 18, 2024
7f523cc
login page tests for validated email
MonikaTheiss Oct 20, 2024
423e572
final fixes
MonikaTheiss Oct 20, 2024
2a31c07
hotfixed error on level 2
pieryvdl Oct 20, 2024
a92460d
Merge pull request #651 from COS301-SE-2024/feat/emailVerification
MonikaTheiss Oct 20, 2024
8bb35cd
🚀 new background image for space shooter
shan-226 Oct 20, 2024
91d9663
Merge pull request #653 from COS301-SE-2024/feat/SpaceShooterBackground
shan-226 Oct 20, 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
5 changes: 5 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ jobs:
echo "DEFAULT_IMAGE_URL=${{ secrets.DEFAULT_IMAGE_URL }}" >> .env
echo "DEFAULT_BANNER_URL=${{ secrets.DEFAULT_BANNER_URL }}" >> .env
echo "RAWG_API_KEY=${{ secrets.RAWG_API_KEY }}" >> .env
echo "RAWG_API_KEY2=${{ secrets.RAWG_API_KEY2 }}" >> .env
echo "RAWG_API_KEY3=${{ secrets.RAWG_API_KEY3 }}" >> .env
echo "RAWG_API_KEY4=${{ secrets.RAWG_API_KEY4 }}" >> .env
echo "RAWG_API_KEY5=${{ secrets.RAWG_API_KEY5 }}" >> .env
echo "RAWG_API_KEY6=${{ secrets.RAWG_API_KEY6 }}" >> .env
shell: bash

# Step 5: Create local.properties file
Expand Down
6 changes: 6 additions & 0 deletions .github/workflows/flutter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,12 @@ jobs:
echo "IOS_BUNDLE_ID=${{ secrets.IOS_BUNDLE_ID }}" >> .env
echo "DEFAULT_IMAGE_URL=${{ secrets.DEFAULT_IMAGE_URL }}" >> .env
echo "DEFAULT_BANNER_URL=${{ secrets.DEFAULT_BANNER_URL }}" >> .env
echo "RAWG_API_KEY=${{ secrets.RAWG_API_KEY }}" >> .env
echo "RAWG_API_KEY2=${{ secrets.RAWG_API_KEY2 }}" >> .env
echo "RAWG_API_KEY3=${{ secrets.RAWG_API_KEY3 }}" >> .env
echo "RAWG_API_KEY4=${{ secrets.RAWG_API_KEY4 }}" >> .env
echo "RAWG_API_KEY5=${{ secrets.RAWG_API_KEY5 }}" >> .env
echo "RAWG_API_KEY6=${{ secrets.RAWG_API_KEY6 }}" >> .env
shell: bash

# Step 4: Install all the dependencies
Expand Down
231 changes: 170 additions & 61 deletions README.md

Large diffs are not rendered by default.

Binary file added assets/default_images/Frame 158.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/default_images/Logo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/default_images/byte_squad_logo 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified assets/images/stars_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 21 additions & 16 deletions assets/tiles/GameyCon.tiled-session
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"height": 4300,
"width": 2
},
"activeFile": "Level-5.tmx",
"activeFile": "Level-6.tmx",
"expandedProjectPaths": [
"."
],
Expand All @@ -21,25 +21,25 @@
"selectedLayer": 1,
"viewCenter": {
"x": 184.658956809063,
"y": 221.2886476280387
"y": 318.71607269294316
}
},
"Level-2.tmx": {
"expandedObjectLayers": [
3,
2
2,
3
],
"scale": 1.3240625,
"selectedLayer": 1,
"viewCenter": {
"x": 183.90370545197072,
"y": 319.84894972858154
"y": 319.47132405003543
}
},
"Level-3.tmx": {
"expandedObjectLayers": [
3,
2
2,
3
],
"scale": 1.3240625,
"selectedLayer": 1,
Expand All @@ -50,8 +50,8 @@
},
"Level-4.tmx": {
"expandedObjectLayers": [
3,
2
2,
3
],
"scale": 1.3240625,
"selectedLayer": 1,
Expand All @@ -62,19 +62,23 @@
},
"Level-5.tmx": {
"expandedObjectLayers": [
3,
2
2,
3
],
"scale": 1.3240625,
"selectedLayer": 1,
"viewCenter": {
"x": 175.5959405239556,
"y": 529.4312013216899
"x": 183.90370545197072,
"y": 319.84894972858154
}
},
"Level-6.tmx": {
"expandedObjectLayers": [
2,
3
],
"scale": 1.3240625,
"selectedLayer": 0,
"selectedLayer": 1,
"viewCenter": {
"x": 183.90370545197072,
"y": 320.2265754071277
Expand All @@ -92,7 +96,8 @@
"Level-2.tmx",
"Level-3.tmx",
"Level-4.tmx",
"Level-5.tmx"
"Level-5.tmx",
"Level-6.tmx"
],
"project": "GameyCon.tiled-project",
"property.type": "string",
Expand All @@ -102,8 +107,8 @@
"Level-3.tmx",
"Level-4.tmx",
"Level-5.tmx",
"GameyCon.tsx",
"Level-6.tmx",
"GameyCon.tsx",
"level-1.tmx",
"level-2.tmx"
],
Expand Down
2 changes: 1 addition & 1 deletion assets/tiles/Level-2.tmx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@
<property name="offPos" type="float" value="5"/>
</properties>
</object>
<object id="43" name="Player" type="Player" x="51.3571" y="572.481" width="33.2311" height="31.7206"/>
<object id="43" name="Player" type="Player" x="67.9726" y="570.97" width="33.2311" height="31.7206"/>
</objectgroup>
<objectgroup id="3" name="Collisions">
<object id="9" x="0" y="0.755251" width="15.105" height="638.187"/>
Expand Down
107 changes: 107 additions & 0 deletions assets/tiles/Level-6.tmx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
<?xml version="1.0" encoding="UTF-8"?>
<map version="1.10" tiledversion="1.11.0" orientation="orthogonal" renderorder="right-down" width="23" height="40" tilewidth="16" tileheight="16" infinite="0" nextlayerid="4" nextobjectid="28">
<tileset firstgid="1" source="GameyCon.tsx"/>
<layer id="1" name="Background" width="23" height="40">
<data encoding="csv">
35,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,35,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0,0,0,0,38,
38,0,0,0,0,0,0,0,0,106,107,108,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,106,107,108,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,106,107,108,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,106,107,108,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,106,107,108,0,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,106,107,108,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,
38,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,
35,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,14,35
</data>
</layer>
<objectgroup id="2" name="Spawnpoints">
<object id="18" name="Player" type="Player" x="55.8886" y="544.536" width="31.7206" height="31.7206"/>
<object id="19" name="Chicken" type="Chicken" x="318.716" y="591.739" width="31.7206" height="30.9653">
<properties>
<property name="offNeg" type="float" value="18"/>
<property name="offPos" type="float" value="1"/>
</properties>
</object>
<object id="20" name="Melon" type="Fruit" x="152.561" y="80.8119" width="31.7206" height="30.2101"/>
<object id="21" type="Checkpoint" x="57.0215" y="18.5036" width="62.6859" height="62.6859"/>
<object id="22" name="Apple" type="Fruit" x="151.806" y="257.541" width="31.7206" height="30.2101"/>
<object id="24" type="Saw" x="239.415" y="288.128" width="31.7206" height="30.9653">
<properties>
<property name="isVertical" type="bool" value="true"/>
<property name="offNeg" type="float" value="2"/>
<property name="offPos" type="float" value="4"/>
</properties>
</object>
<object id="25" type="Saw" x="64.1963" y="429.36" width="31.7206" height="30.9653">
<properties>
<property name="isVertical" type="bool" value="true"/>
<property name="offNeg" type="float" value="2"/>
<property name="offPos" type="float" value="4"/>
</properties>
</object>
<object id="26" type="Saw" x="65.7068" y="162.001" width="31.7206" height="30.9653">
<properties>
<property name="isVertical" type="bool" value="true"/>
<property name="offNeg" type="float" value="2"/>
<property name="offPos" type="float" value="4"/>
</properties>
</object>
<object id="27" type="Saw" x="302.856" y="49.469" width="31.7206" height="30.9653">
<properties>
<property name="isVertical" type="bool" value="true"/>
<property name="offNeg" type="float" value="2"/>
<property name="offPos" type="float" value="4"/>
</properties>
</object>
</objectgroup>
<objectgroup id="3" name="Collisions">
<object id="1" x="0.755264" y="1.13281" width="13.5945" height="621.572"/>
<object id="2" x="353.458" y="1.13281" width="13.5945" height="621.572"/>
<object id="3" x="17.3714" y="0.755265" width="334.575" height="15.105"/>
<object id="4" x="0.755831" y="623.082" width="367.051" height="15.105"/>
<object id="5" x="63.8193" y="81.5672" width="47.5798" height="15.105"/>
<object id="6" x="144.631" y="113.288" width="47.5798" height="15.105"/>
<object id="7" x="224.688" y="145.008" width="47.5798" height="15.105"/>
<object id="8" x="288.129" y="192.589" width="47.5798" height="15.105"/>
<object id="9" x="224.688" y="240.17" width="47.5798" height="15.105"/>
<object id="10" x="143.876" y="287.751" width="47.5798" height="15.105"/>
<object id="11" x="63.8193" y="335.332" width="47.5798" height="15.105"/>
<object id="12" x="143.121" y="368.563" width="47.5798" height="15.105"/>
<object id="13" x="223.177" y="416.144" width="47.5798" height="15.105"/>
<object id="14" x="287.374" y="481.095" width="47.5798" height="15.105"/>
<object id="15" x="208.072" y="512.06" width="47.5798" height="15.105"/>
<object id="16" x="128.771" y="543.781" width="47.5798" height="15.105"/>
<object id="17" x="47.959" y="577.767" width="47.5798" height="15.105"/>
</objectgroup>
</map>
22 changes: 21 additions & 1 deletion lib/main.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// ignore_for_file: prefer_const_constructors

import 'dart:math';

import 'package:flame/flame.dart';
import 'package:flutter/material.dart';
import 'package:firebase_core/firebase_core.dart';
Expand Down Expand Up @@ -32,7 +34,7 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized();

await dotenv.load();
globals.apiKey = dotenv.env['RAWG_API_KEY'];
_loadRandomApiKey();
await Firebase.initializeApp(
options: DefaultFirebaseOptions.currentPlatform,
);
Expand Down Expand Up @@ -93,12 +95,30 @@ void main() async {
ChangeNotifierProvider.value(value: themeProvider, child: const MyApp()));
}

void _loadRandomApiKey() {
final apiKeys = [
dotenv.env['RAWG_API_KEY'],
dotenv.env['RAWG_API_KEY2'],
dotenv.env['RAWG_API_KEY3'],
dotenv.env['RAWG_API_KEY4'],
dotenv.env['RAWG_API_KEY5'],
dotenv.env['RAWG_API_KEY6'],
];

final random = Random(DateTime.now().millisecondsSinceEpoch);
final selectedApiKey = apiKeys[random.nextInt(apiKeys.length)];

globals.apiKey = selectedApiKey;
}

class MyApp extends StatelessWidget {
// ignore: use_super_parameters
const MyApp({Key? key}) : super(key: key);


@override
Widget build(BuildContext context) {
SystemChrome.setPreferredOrientations([DeviceOrientation.portraitUp,DeviceOrientation.portraitDown]);
return MaterialApp(
title: 'GameOnConnect',
theme: Provider.of<ThemeProvider>(context).themeData,
Expand Down
36 changes: 23 additions & 13 deletions lib/services/profile_S/profile_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -101,21 +101,31 @@ class ProfileService {

Future<String> getProfileName(String userId) async {
FirebaseFirestore db = FirebaseFirestore.instance;
const int maxRetries = 5;
const Duration retryDelay = Duration(milliseconds: 500);

DocumentSnapshot profileSnapshot = await db
.collection("profile_data")
.doc(userId)
.get(); //get the document
Map<String, dynamic> data =
profileSnapshot.data() as Map<String, dynamic>; //map the overall data
Map<String, dynamic> userInfo =
data['username'] as Map<String, dynamic>; //map the username data
// Return profile name if exists otherwise give an empty string
if (profileSnapshot.exists) {
return userInfo['profile_name'];
} else {
return '';
for (int attempt = 0; attempt < maxRetries; attempt++) {
try {
DocumentSnapshot profileSnapshot = await db
.collection("profile_data")
.doc(userId)
.get(); //get the document
Map<String, dynamic> data = profileSnapshot.data()
as Map<String, dynamic>; //map the overall data
Map<String, dynamic> userInfo =
data['username'] as Map<String, dynamic>; //map the username data
// Return profile name if exists otherwise give an empty string
if (profileSnapshot.exists) {
return userInfo['profile_name'];
}
} catch (e) {
//print('Attempt $attempt failed: $e');
}
// Wait before retrying
await Future.delayed(retryDelay);
}
//return empty string if the profile name is not found
return '';
}

Future<void> setCurrentlyPlaying(String gameId) async {
Expand Down
2 changes: 1 addition & 1 deletion lib/view/components/GameyCon/gameycon_game.dart
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class GameyCon extends FlameGame
bool showControls = true;
bool playSounds = true;
double soundVolume = 1.0;
List<String> levelNames = ['Level-1', 'Level-2', 'Level-3', 'Level-4', 'Level-5'];
List<String> levelNames = ['Level-1', 'Level-2', 'Level-3', 'Level-4', 'Level-5', 'Level-6'];
int currentLevelIndex = 0;

GameyCon({required String selectedCharacter}) {
Expand Down
2 changes: 1 addition & 1 deletion lib/view/components/home/start_timer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class _GameTimer extends State<GameTimer> {
return Text('Error: ${snapshot.error}');
} else if (!snapshot.hasData ||
snapshot.data!.isEmpty) {
return const Text('No data found');
return const Text('Add a game to \'My Games\' to start');
} else {
return FittedBox(
child: DropdownMenu<String>(
Expand Down
21 changes: 17 additions & 4 deletions lib/view/components/settings/edit_input_text.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@ class EditInputText extends StatefulWidget {
final String label;
final void Function(String value) onChanged;
final String input;
final int maxLines;
final int maxLength;
final Key inputKey;
final bool validate;

const EditInputText(
{super.key,
required this.maxLines,
required this.maxLength,
required this.label,
required this.onChanged,
required this.input,
required this.inputKey});
required this.inputKey,
required this.validate});

@override
State<EditInputText> createState() => _EditInputText();
Expand Down Expand Up @@ -56,7 +58,18 @@ class _EditInputText extends State<EditInputText> {
),
initialValue: widget.input,
style: TextStyle(color: Theme.of(context).colorScheme.secondary, fontSize: 12),
maxLines: widget.maxLines,
maxLength: widget.maxLength,
validator: widget.validate?(value) {
if (value == null || value.isEmpty) {
return 'Please enter a username';
}
if (!RegExp(r'^[a-zA-Z ]+$').hasMatch(value)) {
return 'Only alphabetical letters are permitted';
}
return null;
}: (value){
return null;
},
),
],
),
Expand Down
Loading
Loading