Skip to content

Commit 2fee309

Browse files
committed
Primo commit
1 parent 190341a commit 2fee309

319 files changed

Lines changed: 11494 additions & 1 deletion

File tree

Some content is hidden

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

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Godot-specific ignores
2+
.import/
3+
export.cfg
4+
export_presets.cfg
5+
6+
# Imported translations (automatically generated from CSV files)
7+
*.translation
8+
9+
# Mono-specific ignores
10+
.mono/
11+
data_*/

README.md

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,93 @@
1-
# progettoMobileComputing
1+
# Samurai Game
2+
3+
Un gioco platform a tema samurai sviluppato per piattaforme mobile.
4+
Samurai Game è stato realizzato per il corso di Mobile Computing di Roma Tre (2021/2022).
5+
6+
Autore : *Luca Gregori*
7+
8+
![Spuntoni](docs/demo.gif)
9+
10+
## Wiki
11+
Qui di seguito saranno mostrati i principali aspetti del gioco.
12+
### Obiettivi
13+
14+
| Immagine | Obiettivo |
15+
|------------------------|--------------------------------------------------|
16+
| ![Coin](docs/coin.gif) | Collezionare le monete sparse per il gioco |
17+
| ![Skull](docs/skull.gif) | Raccogliore il teschio per concludere il livello |
18+
19+
20+
### Consigli
21+
22+
![Wiki](docs/screenshot1.png "Consigli")
23+
24+
> Esegui un attacco corpo a corpo contro una freccia in arrivo per rimandarla indietro e uccidere l'arciere o qualsiasi nemico che si trova in mezzo.
25+
26+
> Se lasciato indisturbato lo spadaccino con lo scudo non ti attaccherà.
27+
28+
29+
### Nemici
30+
31+
| Immagine | Entità | Velocità | Attacco | Difesa | Vita | Descrizione |
32+
|-----------------------------------------------------------------------|----------------------|----------|---------|--------|------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
33+
| ![Skeleton](docs/skeleton.gif) | **Scheletro** | Veloce | Mischia | No | 1 HP | Nemico semplice che esegue attacchi in mischia. |
34+
| ![Knight](docs/knight.gif) | **Spadaccino** | Medio | Spada | No | 2 HP | Nemico che esegue attacchi con la spada. |
35+
| ![Shield](docs/shield.png) | **Spadaccino** con scudo | Lento | Spada | Scudo | 3 HP | Quando chiude la distanza del giocatore alza in automatico lo scudo per difendersi.<br/>Se si colpisce lo scudo il colpo verrò parato e il nemico contrattaccherà subito dopo.<br/>Se non si dovesse colpire il nemico mentre questo è con lo scudo alzato c'è una buona probabilità che questo esegua un attacco di sua iniziativa.<br/>La probabilità di attacco per iniziativa aumenta man mano che passa il tempo.<br/> |
36+
| ![Archer](docs/archer.gif) | **Arciere** | Medio | Arco | No | 2 HP | Appena il giocatore entrerà nel campo visivo dell'arciere quest'ultimo scaglierà una freccia verso lui.<br/>Le frecce possono danneggiare anche gli altri nemici oltre che il giocatore. |
37+
| ![YellowArcher](docs/yellow_archer.gif) | **Arciere Giallo** | Medio | Arco | No | 2 HP | Si comporta come un arciere normale, tuttavia scocca 5 freccie consecutive in rapida successione come singolo attacco. |
38+
| ![RedArcher](docs/red_archer.gif) | **Arciere Rosso** | Medio | Arco | No | 2 HP | Si comporta come un arciere normale, tuttavia scocca 3 freccie contemporaneamente in un singolo attacco. | |
39+
40+
### Altro
41+
42+
| Immagine | Descrizione |
43+
|---------------------------------------------------------------------|-------------------------------------------------------|
44+
| ![CircularSaw](docs/circular_saw.png) | Sega circolante in grado di danneggiare il giocatore. |
45+
| ![Spuntoni](docs/spuntoni.png) | Spuntoni in grado di danneggiare il giocatore. |
46+
47+
48+
### Livelli
49+
50+
Al momento sono disponibili due livelli.
51+
52+
![Selezione livello](docs/screenshot3.png "Schermata di selezione del livello")
53+
*Screenshot della schermata di selezione del livello.*
54+
55+
---
56+
57+
![Primo livello](docs/screenshot4.png "Primo livello")
58+
*Screenshot del primo livello.*
59+
60+
---
61+
62+
![Secondo livello](docs/screenshot5.png "Secondo livello")
63+
*Screeshot del secondo livello.*
64+
65+
---
66+
67+
68+
## Installazione
69+
Per installare "Samurai Game" su `android` navigare all'interno di questa repository in `release` e scaricare l'**APK**.
70+
Copiare sul proprio dispositivo il file **APK** e, prima di procedere con l'installazione, assicurarsi di abilitare la funzione: `Installa da origini sconosciute`.
71+
Una volta installato il gioco navigare nelle impostazione per fornire all'applicativo le autorizzazioni di lettura e scrittura di file.
72+
Senza questo passaggio non sarà possibile usufruire delle statistiche in game.
73+
74+
Versione di android testata: 6.0
75+
76+
## Riferimenti
77+
78+
Sviluppato e ideato da _Luca Gregori_.
79+
80+
![Secondo livello](docs/screenshot2.png "Secondo livello")
81+
82+
---
83+
84+
[Link ufficiale a Godot.](https://godotengine.org/)
85+
86+
### Assets utilizzati
87+
- Autore: _[Senari Rey](https://senari-rey.itch.io/)_
88+
- Tipo di licenza: CC BY 4.0
89+
- Reperibili al seguente [link](https://senari-rey.itch.io/pixel-art-platformer-tileset)
90+
91+
### Musica utilizzata
92+
- Titolo: Slave Knight Gael (8-bit)
93+
- Reberibile al seguente [link](https://www.youtube.com/watch?v=JBts5_EPu38)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
tool
2+
3+
extends EditorPlugin
4+
5+
var import_plugin
6+
7+
func _enter_tree():
8+
import_plugin = preload("import_plugin.gd").new()
9+
add_import_plugin(import_plugin)
10+
11+
func _exit_tree():
12+
remove_import_plugin(import_plugin)
13+
import_plugin = null
7.39 KB
Loading
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
[remap]
2+
3+
importer="texture"
4+
type="StreamTexture"
5+
path="res://.import/icon.png-d1785e39e0071dbb1073cf2150fa4769.stex"
6+
metadata={
7+
"vram_texture": false
8+
}
9+
10+
[deps]
11+
12+
source_file="res://addons/SpriteSheetImporter/icon.png"
13+
dest_files=[ "res://.import/icon.png-d1785e39e0071dbb1073cf2150fa4769.stex" ]
14+
15+
[params]
16+
17+
compress/mode=0
18+
compress/lossy_quality=0.7
19+
compress/hdr_mode=0
20+
compress/bptc_ldr=0
21+
compress/normal_map=0
22+
flags/repeat=0
23+
flags/filter=false
24+
flags/mipmaps=false
25+
flags/anisotropic=false
26+
flags/srgb=2
27+
process/fix_alpha_border=true
28+
process/premult_alpha=false
29+
process/HDR_as_SRGB=false
30+
process/invert_color=false
31+
stream=false
32+
size_limit=0
33+
detect_3d=false
34+
svg/scale=1.0
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
tool
2+
extends EditorImportPlugin
3+
4+
enum Preset { PRESET_DEFAULT }
5+
6+
func get_importer_name():
7+
return "snkkid.SpriteSheetImporter"
8+
9+
func get_visible_name():
10+
return "Sprite sheet importer"
11+
12+
func get_recognized_extensions():
13+
return ["json"]
14+
15+
func get_save_extension():
16+
return "res"
17+
18+
func get_resource_type():
19+
return "Resource"
20+
21+
func get_preset_count():
22+
return Preset.size()
23+
24+
func get_preset_name(preset):
25+
match preset:
26+
PRESET_DEFAULT: return "Default"
27+
28+
func get_import_options(preset):
29+
match preset:
30+
PRESET_DEFAULT:
31+
return [{
32+
"name": "Import_As_Atlas",
33+
"default_value": true
34+
}]
35+
_:
36+
return []
37+
38+
func get_option_visibility(option, options):
39+
return true
40+
41+
func get_import_order():
42+
return 200
43+
44+
func import(source_file, save_path, options, r_platform_variants, r_gen_files):
45+
print("Importing sprite sheet from "+source_file);
46+
47+
var sheets = read_sprite_sheet(source_file)
48+
if typeof(sheets) == TYPE_INT:
49+
return sheets
50+
51+
if options.Import_As_Atlas:
52+
var sheetFolder = source_file.get_basename()+".sprites";
53+
var err = create_folder(sheetFolder)
54+
if typeof(err) == TYPE_INT:
55+
return 1
56+
57+
var image = ImageTexture.new()
58+
image = load(source_file.get_base_dir().plus_file(sheets.meta.image))
59+
60+
for sheet in sheets.frames:
61+
var texture = AtlasTexture.new()
62+
texture.atlas = image
63+
var name = sheetFolder+"/"+sheet.filename.get_basename()+".tres"
64+
texture.region = Rect2(sheet.frame.x,sheet.frame.y,sheet.frame.w,sheet.frame.h)
65+
save_resource(name, texture)
66+
67+
return ResourceSaver.save("%s.%s" % [save_path, get_save_extension()], Resource.new())
68+
69+
func save_resource(name, texture):
70+
create_folder(name.get_base_dir())
71+
72+
var status = ResourceSaver.save(name, texture)
73+
if status != OK:
74+
printerr("Failed to save resource "+name)
75+
return false
76+
return true
77+
78+
func read_sprite_sheet(fileName):
79+
var nbError = 0
80+
var file = File.new()
81+
if file.open(fileName, file.READ) != OK:
82+
printerr("Failed to load "+fileName)
83+
return 1
84+
var text = file.get_as_text()
85+
var dict = JSON.parse(text).result
86+
file.close()
87+
88+
if !dict:
89+
nbError = nbError + 1
90+
if !dict.has("meta"):
91+
nbError = nbError + 1
92+
if !dict.meta.has("image"):
93+
nbError = nbError + 1
94+
if !dict.has("frames"):
95+
nbError = nbError + 1
96+
if dict.frames.size() == 0:
97+
nbError = nbError + 1
98+
if !dict.frames[0].has("filename"):
99+
nbError = nbError + 1
100+
if !dict.frames[0].has("frame"):
101+
nbError = nbError + 1
102+
if !dict.frames[0].frame.has("x"):
103+
nbError = nbError + 1
104+
if !dict.frames[0].frame.has("y"):
105+
nbError = nbError + 1
106+
if !dict.frames[0].frame.has("w"):
107+
nbError = nbError + 1
108+
if !dict.frames[0].frame.has("h"):
109+
nbError = nbError + 1
110+
111+
if nbError > 0:
112+
printerr("Invalid json data in "+fileName)
113+
return nbError
114+
115+
return dict
116+
117+
func create_folder(folder):
118+
var dir = Directory.new()
119+
if !dir.dir_exists(folder):
120+
if dir.make_dir_recursive(folder) != OK:
121+
printerr("Failed to create folder: " + folder)
122+
return 1
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[plugin]
2+
3+
name="Sprite sheet importer"
4+
description="Importer for sprite sheet JSON (array)"
5+
author="snkkid"
6+
version="1.0"
7+
script="SpriteSheetImporter.gd"
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2018 Andreas Loew / CodeAndWeb GmbH www.codeandweb.com
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in all
13+
# copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
23+
tool
24+
extends EditorPlugin
25+
26+
var import_plugin_tilesheet = null
27+
var import_plugin_spritesheet = null
28+
29+
func get_name():
30+
return "TexturePacker Importer"
31+
32+
33+
func _enter_tree():
34+
import_plugin_tilesheet = preload("texturepacker_import_tileset.gd").new()
35+
add_import_plugin(import_plugin_tilesheet)
36+
import_plugin_spritesheet = preload("texturepacker_import_spritesheet.gd").new()
37+
add_import_plugin(import_plugin_spritesheet)
38+
39+
40+
func _exit_tree():
41+
remove_import_plugin(import_plugin_spritesheet)
42+
import_plugin_spritesheet = null
43+
remove_import_plugin(import_plugin_tilesheet)
44+
import_plugin_tilesheet = null
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
# The MIT License (MIT)
2+
#
3+
# Copyright (c) 2018 George Marques
4+
#
5+
# Permission is hereby granted, free of charge, to any person obtaining a copy
6+
# of this software and associated documentation files (the "Software"), to deal
7+
# in the Software without restriction, including without limitation the rights
8+
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
# copies of the Software, and to permit persons to whom the Software is
10+
# furnished to do so, subject to the following conditions:
11+
#
12+
# The above copyright notice and this permission notice shall be included in all
13+
# copies or substantial portions of the Software.
14+
#
15+
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
# SOFTWARE.
22+
23+
tool
24+
extends Object
25+
26+
func load_image(rel_path, source_path, options):
27+
var flags = options.image_flags if "image_flags" in options else Texture.FLAGS_DEFAULT
28+
var embed = options.embed_internal_images if "embed_internal_images" in options else false
29+
30+
var ext = rel_path.get_extension().to_lower()
31+
if not ext in ["png","jpg","webp","pvr","tga"]:
32+
printerr("Unsupported image format: %s. Use PNG, JPG, WEBP, PVR or TGA instead." % [ext])
33+
return ERR_FILE_UNRECOGNIZED
34+
35+
var total_path = rel_path
36+
if rel_path.is_rel_path():
37+
total_path = ProjectSettings.globalize_path(source_path.get_base_dir()).plus_file(rel_path)
38+
total_path = ProjectSettings.localize_path(total_path)
39+
40+
var dir = Directory.new()
41+
if not dir.file_exists(total_path):
42+
printerr("Image not found: %s" % [total_path])
43+
return ERR_FILE_NOT_FOUND
44+
45+
if not total_path.begins_with("res://"):
46+
# External images need to be embedded
47+
embed = true
48+
49+
var image = null
50+
if embed:
51+
image = ImageTexture.new()
52+
image.load(total_path)
53+
else:
54+
image = ResourceLoader.load(total_path, "ImageTexture")
55+
56+
if image != null:
57+
image.set_flags(flags)
58+
59+
return image

0 commit comments

Comments
 (0)