premiere version
This commit is contained in:
parent
24478b237c
commit
940067c266
17 changed files with 479 additions and 0 deletions
7
default_env.tres
Normal file
7
default_env.tres
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
[gd_resource type="Environment" load_steps=2 format=2]
|
||||||
|
|
||||||
|
[sub_resource type="ProceduralSky" id=1]
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
background_mode = 2
|
||||||
|
background_sky = SubResource( 1 )
|
101
export_presets.cfg
Normal file
101
export_presets.cfg
Normal file
|
@ -0,0 +1,101 @@
|
||||||
|
[preset.0]
|
||||||
|
|
||||||
|
name="Windows"
|
||||||
|
platform="Windows Desktop"
|
||||||
|
runnable=true
|
||||||
|
custom_features=""
|
||||||
|
export_filter="all_resources"
|
||||||
|
include_filter=""
|
||||||
|
exclude_filter=""
|
||||||
|
export_path="C:/Users/anri/Desktop/WINDOWS/Jeu Godot.exe"
|
||||||
|
patch_list=PoolStringArray( )
|
||||||
|
script_export_mode=1
|
||||||
|
script_encryption_key=""
|
||||||
|
|
||||||
|
[preset.0.options]
|
||||||
|
|
||||||
|
texture_format/bptc=false
|
||||||
|
texture_format/s3tc=true
|
||||||
|
texture_format/etc=false
|
||||||
|
texture_format/etc2=false
|
||||||
|
texture_format/no_bptc_fallbacks=true
|
||||||
|
binary_format/64_bits=true
|
||||||
|
binary_format/embed_pck=true
|
||||||
|
custom_template/release=""
|
||||||
|
custom_template/debug=""
|
||||||
|
codesign/enable=false
|
||||||
|
codesign/identity_type=0
|
||||||
|
codesign/identity=""
|
||||||
|
codesign/password=""
|
||||||
|
codesign/timestamp=true
|
||||||
|
codesign/timestamp_server_url=""
|
||||||
|
codesign/digest_algorithm=1
|
||||||
|
codesign/description=""
|
||||||
|
codesign/custom_options=PoolStringArray( )
|
||||||
|
application/icon=""
|
||||||
|
application/file_version=""
|
||||||
|
application/product_version=""
|
||||||
|
application/company_name="Anri Kennel"
|
||||||
|
application/product_name="Jeu Godot"
|
||||||
|
application/file_description="Jeu fait par Anri K."
|
||||||
|
application/copyright=""
|
||||||
|
application/trademarks=""
|
||||||
|
|
||||||
|
[preset.1]
|
||||||
|
|
||||||
|
name="Linux"
|
||||||
|
platform="Linux/X11"
|
||||||
|
runnable=true
|
||||||
|
custom_features=""
|
||||||
|
export_filter="all_resources"
|
||||||
|
include_filter=""
|
||||||
|
exclude_filter=""
|
||||||
|
export_path="C:/Users/anri/Desktop/LINUX/Jeu Godot.x86_64"
|
||||||
|
patch_list=PoolStringArray( )
|
||||||
|
script_export_mode=1
|
||||||
|
script_encryption_key=""
|
||||||
|
|
||||||
|
[preset.1.options]
|
||||||
|
|
||||||
|
texture_format/bptc=false
|
||||||
|
texture_format/s3tc=true
|
||||||
|
texture_format/etc=false
|
||||||
|
texture_format/etc2=false
|
||||||
|
texture_format/no_bptc_fallbacks=true
|
||||||
|
binary_format/64_bits=true
|
||||||
|
binary_format/embed_pck=true
|
||||||
|
custom_template/release=""
|
||||||
|
custom_template/debug=""
|
||||||
|
|
||||||
|
[preset.2]
|
||||||
|
|
||||||
|
name="Mac OSX"
|
||||||
|
platform="Mac OSX"
|
||||||
|
runnable=true
|
||||||
|
custom_features=""
|
||||||
|
export_filter="all_resources"
|
||||||
|
include_filter=""
|
||||||
|
exclude_filter=""
|
||||||
|
export_path="C:/Users/anri/Desktop/MACOSX/jeu Godot.zip"
|
||||||
|
patch_list=PoolStringArray( )
|
||||||
|
script_export_mode=1
|
||||||
|
script_encryption_key=""
|
||||||
|
|
||||||
|
[preset.2.options]
|
||||||
|
|
||||||
|
custom_template/debug=""
|
||||||
|
custom_template/release=""
|
||||||
|
application/name="Jeu Godot"
|
||||||
|
application/info="Jeu Godot par Anri Kennel"
|
||||||
|
application/icon=""
|
||||||
|
application/identifier="com.akennel.jeuGodot"
|
||||||
|
application/signature=""
|
||||||
|
application/short_version="1.0"
|
||||||
|
application/version="1.0"
|
||||||
|
application/copyright=""
|
||||||
|
display/high_res=true
|
||||||
|
privacy/camera_usage_description=""
|
||||||
|
privacy/microphone_usage_description=""
|
||||||
|
texture_format/s3tc=true
|
||||||
|
texture_format/etc=false
|
||||||
|
texture_format/etc2=false
|
BIN
icon.png
(Stored with Git LFS)
Normal file
BIN
icon.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
images/Batiment.png
(Stored with Git LFS)
Normal file
BIN
images/Batiment.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
images/Fond.png
(Stored with Git LFS)
Normal file
BIN
images/Fond.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
images/Lumière.png
(Stored with Git LFS)
Normal file
BIN
images/Lumière.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
images/balle.png
(Stored with Git LFS)
Normal file
BIN
images/balle.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
images/joueur.png
(Stored with Git LFS)
Normal file
BIN
images/joueur.png
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
images/mechant.png
(Stored with Git LFS)
Normal file
BIN
images/mechant.png
(Stored with Git LFS)
Normal file
Binary file not shown.
56
project.godot
Normal file
56
project.godot
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
; Engine configuration file.
|
||||||
|
; It's best edited using the editor UI and not directly,
|
||||||
|
; since the parameters that go here are not all obvious.
|
||||||
|
;
|
||||||
|
; Format:
|
||||||
|
; [section] ; section goes between []
|
||||||
|
; param=value ; assign values to parameters
|
||||||
|
|
||||||
|
config_version=4
|
||||||
|
|
||||||
|
_global_script_classes=[ ]
|
||||||
|
_global_script_class_icons={
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
[application]
|
||||||
|
|
||||||
|
config/name="Jeu Godot"
|
||||||
|
run/main_scene="res://scenes/Monde.tscn"
|
||||||
|
config/icon="res://icon.png"
|
||||||
|
|
||||||
|
[input]
|
||||||
|
|
||||||
|
haut={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":90,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777232,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
bas={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":83,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777234,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
droite={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":68,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777233,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
gauche={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":81,"unicode":0,"echo":false,"script":null)
|
||||||
|
, Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"pressed":false,"scancode":16777231,"unicode":0,"echo":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
clicGauche={
|
||||||
|
"deadzone": 0.5,
|
||||||
|
"events": [ Object(InputEventMouseButton,"resource_local_to_scene":false,"resource_name":"","device":0,"alt":false,"shift":false,"control":false,"meta":false,"command":false,"button_mask":0,"position":Vector2( 0, 0 ),"global_position":Vector2( 0, 0 ),"factor":1.0,"button_index":1,"pressed":false,"doubleclick":false,"script":null)
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
|
[rendering]
|
||||||
|
|
||||||
|
environment/default_environment="res://default_env.tres"
|
23
scenes/Balle.tscn
Normal file
23
scenes/Balle.tscn
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
[gd_scene load_steps=3 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://images/balle.png" type="Texture" id=1]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
|
extents = Vector2( 2, 0.5 )
|
||||||
|
|
||||||
|
[node name="Balle" type="RigidBody2D"]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D_devant" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2( -2, 0 )
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D_haut" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2( 2, -1 )
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D_bas" type="CollisionShape2D" parent="."]
|
||||||
|
position = Vector2( 2, 1 )
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
texture = ExtResource( 1 )
|
25
scenes/Ennemi.tscn
Normal file
25
scenes/Ennemi.tscn
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
[gd_scene load_steps=5 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://images/mechant.png" type="Texture" id=1]
|
||||||
|
[ext_resource path="res://scripts/Ennemi.gd" type="Script" id=2]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=1]
|
||||||
|
extents = Vector2( 6.5, 6.5 )
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=2]
|
||||||
|
extents = Vector2( 7, 7 )
|
||||||
|
|
||||||
|
[node name="Ennemi" type="KinematicBody2D"]
|
||||||
|
script = ExtResource( 2 )
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
|
||||||
|
shape = SubResource( 1 )
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="Area2D" type="Area2D" parent="."]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Area2D"]
|
||||||
|
shape = SubResource( 2 )
|
||||||
|
[connection signal="body_entered" from="Area2D" to="." method="_on_Area2D_body_entered"]
|
131
scenes/Monde.tscn
Normal file
131
scenes/Monde.tscn
Normal file
File diff suppressed because one or more lines are too long
33
scenes/mur.tres
Normal file
33
scenes/mur.tres
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
[gd_resource type="TileSet" load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://images/Batiment.png" type="Texture" id=1]
|
||||||
|
|
||||||
|
[sub_resource type="OccluderPolygon2D" id=1]
|
||||||
|
polygon = PoolVector2Array( -8.00226, -7.97379, -7.99188, 7.99426, 8.00321, 7.99426, 8.01305, -8.00083 )
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=2]
|
||||||
|
extents = Vector2( 8, 8 )
|
||||||
|
|
||||||
|
[resource]
|
||||||
|
0/name = "Sprite"
|
||||||
|
0/texture = ExtResource( 1 )
|
||||||
|
0/tex_offset = Vector2( 0, 0 )
|
||||||
|
0/modulate = Color( 1, 1, 1, 1 )
|
||||||
|
0/region = Rect2( 0, 0, 16, 16 )
|
||||||
|
0/tile_mode = 0
|
||||||
|
0/occluder_offset = Vector2( 8, 8 )
|
||||||
|
0/occluder = SubResource( 1 )
|
||||||
|
0/navigation_offset = Vector2( 8, 8 )
|
||||||
|
0/shape_offset = Vector2( 8, 8 )
|
||||||
|
0/shape_transform = Transform2D( 1, 0, 0, 1, 8, 8 )
|
||||||
|
0/shape = SubResource( 2 )
|
||||||
|
0/shape_one_way = false
|
||||||
|
0/shape_one_way_margin = 1.0
|
||||||
|
0/shapes = [ {
|
||||||
|
"autotile_coord": Vector2( 0, 0 ),
|
||||||
|
"one_way": false,
|
||||||
|
"one_way_margin": 1.0,
|
||||||
|
"shape": SubResource( 2 ),
|
||||||
|
"shape_transform": Transform2D( 1, 0, 0, 1, 8, 8 )
|
||||||
|
} ]
|
||||||
|
0/z_index = 0
|
22
scenes/mur.tscn
Normal file
22
scenes/mur.tscn
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
[gd_scene load_steps=4 format=2]
|
||||||
|
|
||||||
|
[ext_resource path="res://images/Batiment.png" type="Texture" id=1]
|
||||||
|
|
||||||
|
[sub_resource type="RectangleShape2D" id=2]
|
||||||
|
extents = Vector2( 8, 8 )
|
||||||
|
|
||||||
|
[sub_resource type="OccluderPolygon2D" id=1]
|
||||||
|
polygon = PoolVector2Array( -8.00226, -7.97379, -7.99188, 7.99426, 8.00321, 7.99426, 8.01305, -8.00083 )
|
||||||
|
|
||||||
|
[node name="Node2D" type="Node2D"]
|
||||||
|
|
||||||
|
[node name="Sprite" type="Sprite" parent="."]
|
||||||
|
texture = ExtResource( 1 )
|
||||||
|
|
||||||
|
[node name="StaticBody2D" type="StaticBody2D" parent="Sprite"]
|
||||||
|
|
||||||
|
[node name="CollisionShape2D" type="CollisionShape2D" parent="Sprite/StaticBody2D"]
|
||||||
|
shape = SubResource( 2 )
|
||||||
|
|
||||||
|
[node name="LightOccluder2D" type="LightOccluder2D" parent="Sprite"]
|
||||||
|
occluder = SubResource( 1 )
|
18
scripts/Ennemi.gd
Normal file
18
scripts/Ennemi.gd
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
extends KinematicBody2D
|
||||||
|
|
||||||
|
var deplacement = Vector2()
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func _physics_process(delta):
|
||||||
|
var Joueur = get_parent().get_node("Joueur") # récupère le joueur
|
||||||
|
|
||||||
|
position += (Joueur.position - position) / 50 # rapidité
|
||||||
|
look_at(Joueur.position) # regarde le joueur
|
||||||
|
|
||||||
|
move_and_collide(deplacement) # initie le déplacement
|
||||||
|
|
||||||
|
func _on_Area2D_body_entered(body):
|
||||||
|
if "Balle" in body.name:
|
||||||
|
queue_free()
|
42
scripts/Joueur.gd
Normal file
42
scripts/Joueur.gd
Normal file
|
@ -0,0 +1,42 @@
|
||||||
|
extends KinematicBody2D
|
||||||
|
|
||||||
|
var vitesseDeplacement = 500
|
||||||
|
var vitesseBalle = 2000
|
||||||
|
|
||||||
|
var balle = preload("res://scenes/Balle.tscn")
|
||||||
|
|
||||||
|
func _ready():
|
||||||
|
pass
|
||||||
|
|
||||||
|
func _process(delta):
|
||||||
|
var deplacement = Vector2() # déplacement du personnage
|
||||||
|
|
||||||
|
if Input.is_action_pressed("haut"): # vers le haut
|
||||||
|
deplacement.y -= 1
|
||||||
|
if Input.is_action_pressed("bas"): # vers le bas
|
||||||
|
deplacement.y += 1
|
||||||
|
if Input.is_action_pressed("gauche"): # vers la gauche
|
||||||
|
deplacement.x -= 1
|
||||||
|
if Input.is_action_pressed("droite"): # vers la droite
|
||||||
|
deplacement.x += 1
|
||||||
|
|
||||||
|
deplacement = deplacement.normalized() # empeche de doubler la vitesse en diagonale
|
||||||
|
deplacement = move_and_slide(deplacement * vitesseDeplacement) # vitesse
|
||||||
|
look_at(get_global_mouse_position()) # regarde le curseur
|
||||||
|
|
||||||
|
if Input.is_action_just_pressed("clicGauche"):
|
||||||
|
tir()
|
||||||
|
|
||||||
|
func tir():
|
||||||
|
var objectBalle = balle.instance() # création object balle
|
||||||
|
objectBalle.position = get_global_position() # récupération de la position
|
||||||
|
objectBalle.rotation_degrees = rotation_degrees # récupération du degré de rotation
|
||||||
|
objectBalle.apply_impulse(Vector2(), Vector2(vitesseBalle, 0).rotated(rotation)) # lancement de la balle
|
||||||
|
get_tree().get_root().call_deferred("add_child", objectBalle) # ajout de la balle
|
||||||
|
|
||||||
|
func mort():
|
||||||
|
get_tree().reload_current_scene()
|
||||||
|
|
||||||
|
func _on_Area2D_body_entered(body):
|
||||||
|
if "Ennemi" in body.name: # collision avec l'ennemi
|
||||||
|
mort()
|
Reference in a new issue