From 4acaef7d25a79b65f5951b1056efcf3960147525 Mon Sep 17 00:00:00 2001 From: Relintai Date: Sat, 19 Mar 2022 20:28:23 +0100 Subject: [PATCH] Removed some of the rst files. --- about/docs_changelog.rst | 221 ------- about/index.rst | 2 - about/release_policy.rst | 149 ----- .../first_2d_game/01.project_setup.rst | 77 --- .../first_2d_game/02.player_scene.rst | 100 ---- .../first_2d_game/03.coding_the_player.rst | 543 ----------------- .../first_2d_game/04.creating_the_enemy.rst | 180 ------ .../first_2d_game/05.the_main_game_scene.rst | 452 -------------- .../first_2d_game/06.heads_up_display.rst | 438 -------------- .../first_2d_game/07.finishing-up.rst | 79 --- .../first_2d_game/files/dodge_assets.zip | Bin 1826007 -> 0 bytes .../files/dodge_assets_with_gdnative.zip | Bin 1821507 -> 0 bytes .../first_2d_game/img/add_node.png | Bin 9855 -> 0 bytes .../first_2d_game/img/add_script_button.png | Bin 6412 -> 0 bytes .../first_2d_game/img/attach_node_window.png | Bin 23322 -> 0 bytes .../img/completed_main_scene.png | Bin 5661 -> 0 bytes .../first_2d_game/img/custom_font1.png | Bin 19737 -> 0 bytes .../first_2d_game/img/custom_font2.png | Bin 16516 -> 0 bytes .../first_2d_game/img/custom_font3.png | Bin 8302 -> 0 bytes .../first_2d_game/img/dodge_preview.gif | Bin 844405 -> 0 bytes .../first_2d_game/img/draw_path2d.gif | Bin 82670 -> 0 bytes .../first_2d_game/img/export_variable.png | Bin 29159 -> 0 bytes .../first_2d_game/img/filesystem_dock.png | Bin 4493 -> 0 bytes .../first_2d_game/img/folder-content.png | Bin 16999 -> 0 bytes .../first_2d_game/img/grid_snap_button.png | Bin 3021 -> 0 bytes .../first_2d_game/img/group_tab.png | Bin 8244 -> 0 bytes .../img/input-mapping-add-action.png | Bin 17408 -> 0 bytes .../img/input-mapping-add-key.png | Bin 21379 -> 0 bytes .../img/input-mapping-completed.png | Bin 71618 -> 0 bytes .../first_2d_game/img/instance_scene.png | Bin 2738 -> 0 bytes .../first_2d_game/img/lock_children.png | Bin 21263 -> 0 bytes .../first_2d_game/img/main_scene_nodes.png | Bin 8715 -> 0 bytes .../first_2d_game/img/mob_animations.gif | Bin 47479 -> 0 bytes .../first_2d_game/img/new-project-button.png | Bin 35646 -> 0 bytes .../first_2d_game/img/path2d_buttons.png | Bin 1885 -> 0 bytes .../first_2d_game/img/player_coll_shape.png | Bin 34078 -> 0 bytes .../first_2d_game/img/player_scale.png | Bin 22522 -> 0 bytes .../first_2d_game/img/player_scene_nodes.png | Bin 6117 -> 0 bytes .../img/player_signal_connection.png | Bin 6637 -> 0 bytes .../first_2d_game/img/player_signals.png | Bin 25538 -> 0 bytes .../first_2d_game/img/set_collision_mask.png | Bin 11711 -> 0 bytes .../img/setting-project-width-and-height.png | Bin 17911 -> 0 bytes .../img/setting-stretch-mode.png | Bin 19189 -> 0 bytes .../first_2d_game/img/spriteframes_panel.png | Bin 14127 -> 0 bytes .../first_2d_game/img/spriteframes_panel2.png | Bin 13905 -> 0 bytes .../img/start_button_shortcut.png | Bin 33825 -> 0 bytes .../first_2d_game/img/ui_anchor.png | Bin 44157 -> 0 bytes getting_started/first_2d_game/index.rst | 76 --- .../first_3d_game/01.game_setup.rst | 164 ----- .../first_3d_game/02.player_input.rst | 177 ------ .../first_3d_game/03.player_movement_code.rst | 413 ------------- .../first_3d_game/04.mob_scene.rst | 332 ----------- .../first_3d_game/05.spawning_mobs.rst | 360 ----------- .../first_3d_game/06.jump_and_squash.rst | 353 ----------- .../first_3d_game/07.killing_player.rst | 467 --------------- .../first_3d_game/08.score_and_replay.rst | 475 --------------- .../first_3d_game/09.adding_animations.rst | 558 ------------------ .../first_3d_game/going_further.rst | 42 -- .../img/01.game_setup/01.import_button.png | Bin 12791 -> 0 bytes .../02.browse_to_project_folder.png | Bin 6108 -> 0 bytes .../img/01.game_setup/03.import_and_edit.png | Bin 3737 -> 0 bytes .../img/01.game_setup/04.start_assets.png | Bin 7114 -> 0 bytes .../img/01.game_setup/05.main_node.png | Bin 1443 -> 0 bytes .../img/01.game_setup/06.staticbody_node.png | Bin 2698 -> 0 bytes .../07.collision_shape_warning.png | Bin 3383 -> 0 bytes .../img/01.game_setup/08.create_box_shape.png | Bin 8232 -> 0 bytes .../img/01.game_setup/09.box_extents.png | Bin 2948 -> 0 bytes .../img/01.game_setup/10.mesh_instance.png | Bin 3285 -> 0 bytes .../img/01.game_setup/11.cube_mesh.png | Bin 4873 -> 0 bytes .../img/01.game_setup/12.cube_resized.png | Bin 3572 -> 0 bytes .../01.game_setup/13.move_gizmo_y_axis.png | Bin 16409 -> 0 bytes .../img/01.game_setup/14.select_mode_icon.png | Bin 1016 -> 0 bytes .../01.game_setup/15.translation_amount.png | Bin 1450 -> 0 bytes .../img/01.game_setup/16.turn_on_shadows.png | Bin 3955 -> 0 bytes .../01.game_setup/17.project_with_light.png | Bin 43403 -> 0 bytes .../img/02.player_input/01.new_scene.png | Bin 3825 -> 0 bytes .../02.instantiating_the_model.png | Bin 2530 -> 0 bytes .../02.player_input/03.scene_structure.png | Bin 2473 -> 0 bytes .../img/02.player_input/04.sphere_shape.png | Bin 9184 -> 0 bytes .../05.moving_the_sphere_up.png | Bin 6249 -> 0 bytes .../06.toggling_visibility.png | Bin 3119 -> 0 bytes .../img/02.player_input/07.adding_action.png | Bin 3769 -> 0 bytes .../img/02.player_input/07.input_map_tab.png | Bin 15993 -> 0 bytes .../02.player_input/07.project_settings.png | Bin 5362 -> 0 bytes .../02.player_input/08.actions_list_empty.png | Bin 1851 -> 0 bytes .../02.player_input/08.create_key_action.png | Bin 1855 -> 0 bytes .../02.player_input/09.keyboard_key_popup.png | Bin 1362 -> 0 bytes .../img/02.player_input/09.keyboard_keys.png | Bin 1325 -> 0 bytes .../02.player_input/10.joy_axis_option.png | Bin 1858 -> 0 bytes .../img/02.player_input/11.joy_axis_popup.png | Bin 4344 -> 0 bytes .../02.player_input/12.move_inputs_mapped.png | Bin 9718 -> 0 bytes .../02.player_input/13.joy_button_option.png | Bin 2092 -> 0 bytes .../02.player_input/14.add_jump_button.png | Bin 3205 -> 0 bytes .../02.player_input/14.jump_input_action.png | Bin 2751 -> 0 bytes .../01.attach_script_to_player.png | Bin 7151 -> 0 bytes .../02.clicking_main_tab.png | Bin 1653 -> 0 bytes .../03.instance_child_scene.png | Bin 15042 -> 0 bytes .../04.scene_tree_with_camera.png | Bin 4915 -> 0 bytes .../05.camera_preview_checkbox.png | Bin 1329 -> 0 bytes .../06.two_viewports.png | Bin 4157 -> 0 bytes .../07.camera_preview_checkbox.png | Bin 1173 -> 0 bytes .../08.camera_moved.png | Bin 1777 -> 0 bytes .../09.camera_rotated.png | Bin 2839 -> 0 bytes .../10.camera_perspective.png | Bin 3110 -> 0 bytes .../11.camera_orthographic.png | Bin 2684 -> 0 bytes .../04.mob_scene/01.initial_three_nodes.png | Bin 2677 -> 0 bytes .../img/04.mob_scene/02.add_child_node.png | Bin 6789 -> 0 bytes .../03.scene_with_collision_shape.png | Bin 3471 -> 0 bytes .../img/04.mob_scene/04.create_box_shape.png | Bin 6959 -> 0 bytes .../img/04.mob_scene/05.box_final_size.png | Bin 21867 -> 0 bytes .../04.mob_scene/06.visibility_notifier.png | Bin 22448 -> 0 bytes .../07.visibility_notifier_bbox_resized.png | Bin 11168 -> 0 bytes .../img/04.mob_scene/08.mob_attach_script.png | Bin 7632 -> 0 bytes .../09.switch_to_3d_workspace.png | Bin 1299 -> 0 bytes .../img/04.mob_scene/10.node_dock.png | Bin 3659 -> 0 bytes .../img/04.mob_scene/11.connect_signal.png | Bin 8404 -> 0 bytes .../01.monsters_path_preview.png | Bin 9548 -> 0 bytes .../05.spawning_mobs/02.project_settings.png | Bin 7479 -> 0 bytes .../05.spawning_mobs/03.window_settings.png | Bin 19644 -> 0 bytes .../05.spawning_mobs/04.camera_preview.png | Bin 24289 -> 0 bytes .../05.spawning_mobs/05.cylinders_node.png | Bin 1381 -> 0 bytes .../img/05.spawning_mobs/06.cylinder_mesh.png | Bin 6335 -> 0 bytes .../img/05.spawning_mobs/07.top_view.png | Bin 2692 -> 0 bytes .../05.spawning_mobs/08.toggle_view_grid.png | Bin 4108 -> 0 bytes .../05.spawning_mobs/09.toggle_grid_snap.png | Bin 1502 -> 0 bytes .../10.place_first_cylinder.png | Bin 5817 -> 0 bytes .../11.both_cylinders_selected.png | Bin 3809 -> 0 bytes .../05.spawning_mobs/12.four_cylinders.png | Bin 3942 -> 0 bytes .../13.selecting_all_cylinders.png | Bin 1951 -> 0 bytes .../05.spawning_mobs/14.spatial_material.png | Bin 3364 -> 0 bytes .../05.spawning_mobs/15.bright-cylinders.png | Bin 23916 -> 0 bytes .../05.spawning_mobs/16.cylinders_fold.png | Bin 1802 -> 0 bytes .../05.spawning_mobs/17.points_options.png | Bin 977 -> 0 bytes .../img/05.spawning_mobs/18.close_path.png | Bin 982 -> 0 bytes .../img/05.spawning_mobs/19.path_result.png | Bin 3873 -> 0 bytes .../20.mob_scene_property.png | Bin 3940 -> 0 bytes .../img/05.spawning_mobs/20.spawn_nodes.png | Bin 1183 -> 0 bytes .../img/05.spawning_mobs/21.mob_timer.png | Bin 620 -> 0 bytes .../22.mob_timer_properties.png | Bin 3880 -> 0 bytes .../05.spawning_mobs/23.timeout_signal.png | Bin 2249 -> 0 bytes .../24.connect_timer_to_main.png | Bin 8379 -> 0 bytes .../img/05.spawning_mobs/25.spawn_result.png | Bin 9917 -> 0 bytes .../02.project_settings.png | Bin 7450 -> 0 bytes .../06.jump_and_squash/03.physics_layers.png | Bin 15432 -> 0 bytes .../04.default_physics_properties.png | Bin 1611 -> 0 bytes .../05.toggle_layer_and_mask.png | Bin 1836 -> 0 bytes .../06.named_checkboxes.png | Bin 3134 -> 0 bytes .../07.player_physics_mask.png | Bin 1178 -> 0 bytes .../08.mob_physics_mask.png | Bin 1116 -> 0 bytes .../img/06.jump_and_squash/09.groups_tab.png | Bin 2470 -> 0 bytes .../10.group_scene_icon.png | Bin 1783 -> 0 bytes .../07.killing_player/01.adding_area_node.png | Bin 2763 -> 0 bytes .../07.killing_player/02.cylinder_shape.png | Bin 6735 -> 0 bytes .../03.cylinder_in_editor.png | Bin 13009 -> 0 bytes .../04.mob_detector_properties.png | Bin 2233 -> 0 bytes .../05.body_entered_signal.png | Bin 4512 -> 0 bytes .../06.player_hit_signal.png | Bin 2291 -> 0 bytes .../img/08.score_and_replay/01.label_node.png | Bin 1260 -> 0 bytes .../02.score_color_picker.png | Bin 18740 -> 0 bytes .../02.score_custom_color.png | Bin 1467 -> 0 bytes .../02.score_label_moved.png | Bin 1513 -> 0 bytes .../02.score_placeholder.png | Bin 2200 -> 0 bytes .../08.score_and_replay/03.creating_theme.png | Bin 3045 -> 0 bytes .../08.score_and_replay/04.theme_preview.png | Bin 7354 -> 0 bytes .../08.score_and_replay/05.dynamic_font.png | Bin 4866 -> 0 bytes .../img/08.score_and_replay/06.font_data.png | Bin 2800 -> 0 bytes .../img/08.score_and_replay/07.font_size.png | Bin 5914 -> 0 bytes .../08.open_main_script.png | Bin 2376 -> 0 bytes .../08.score_and_replay/09.score_in_game.png | Bin 9110 -> 0 bytes .../08.score_and_replay/10.layout_icon.png | Bin 1067 -> 0 bytes .../11.full_rect_option.png | Bin 2126 -> 0 bytes .../12.anchors_updated.png | Bin 1053 -> 0 bytes .../13.retry_color_picker.png | Bin 18807 -> 0 bytes .../img/08.score_and_replay/14.retry_node.png | Bin 2617 -> 0 bytes .../08.score_and_replay/15.layout_center.png | Bin 1483 -> 0 bytes .../img/08.score_and_replay/16.new_scene.png | Bin 4051 -> 0 bytes .../17.music_player_node.png | Bin 1919 -> 0 bytes .../18.music_node_properties.png | Bin 4845 -> 0 bytes .../19.register_autoload.png | Bin 4566 -> 0 bytes .../20.scene_dock_tabs.png | Bin 2564 -> 0 bytes .../21.remote_scene_tree.png | Bin 7274 -> 0 bytes .../01.animation_player_dock.png | Bin 4077 -> 0 bytes .../09.adding_animations/02.new_animation.png | Bin 1072 -> 0 bytes .../09.adding_animations/03.float_name.png | Bin 2324 -> 0 bytes .../img/09.adding_animations/03.timeline.png | Bin 3028 -> 0 bytes .../04.autoplay_and_loop.png | Bin 5971 -> 0 bytes .../img/09.adding_animations/05.pin_icon.png | Bin 644 -> 0 bytes .../06.animation_duration.png | Bin 1057 -> 0 bytes .../07.editable_timeline.png | Bin 2126 -> 0 bytes .../09.adding_animations/08.zoom_slider.png | Bin 3187 -> 0 bytes .../09.creating_first_keyframe.png | Bin 2891 -> 0 bytes .../09.adding_animations/10.initial_keys.png | Bin 3709 -> 0 bytes .../09.adding_animations/11.moving_keys.png | Bin 2239 -> 0 bytes .../12.second_keys_values.png | Bin 2990 -> 0 bytes .../09.adding_animations/13.second_keys.png | Bin 4145 -> 0 bytes .../09.adding_animations/14.play_button.png | Bin 299 -> 0 bytes .../09.adding_animations/15.box_select.png | Bin 8534 -> 0 bytes .../16.easing_property.png | Bin 1670 -> 0 bytes .../img/09.adding_animations/17.ease_out.png | Bin 758 -> 0 bytes .../18.ease_out_second_rotation_key.png | Bin 2568 -> 0 bytes .../19.ease_in_second_translation_key.png | Bin 2753 -> 0 bytes .../20.float_animation.gif | Bin 228946 -> 0 bytes .../09.adding_animations/21.script_icon.png | Bin 2529 -> 0 bytes .../img/squash-the-creeps-final.gif | Bin 1271009 -> 0 bytes getting_started/first_3d_game/index.rst | 70 --- getting_started/introduction/index.rst | 2 - .../introduction/introduction_to_godot.rst | 128 ---- .../introduction/learning_new_features.rst | 151 ----- getting_started/step_by_step/index.rst | 1 - .../step_by_step/scripting_languages.rst | 181 ------ index.rst | 2 - 211 files changed, 6193 deletions(-) delete mode 100644 about/docs_changelog.rst delete mode 100644 about/release_policy.rst delete mode 100644 getting_started/first_2d_game/01.project_setup.rst delete mode 100644 getting_started/first_2d_game/02.player_scene.rst delete mode 100644 getting_started/first_2d_game/03.coding_the_player.rst delete mode 100644 getting_started/first_2d_game/04.creating_the_enemy.rst delete mode 100644 getting_started/first_2d_game/05.the_main_game_scene.rst delete mode 100644 getting_started/first_2d_game/06.heads_up_display.rst delete mode 100644 getting_started/first_2d_game/07.finishing-up.rst delete mode 100644 getting_started/first_2d_game/files/dodge_assets.zip delete mode 100644 getting_started/first_2d_game/files/dodge_assets_with_gdnative.zip delete mode 100644 getting_started/first_2d_game/img/add_node.png delete mode 100644 getting_started/first_2d_game/img/add_script_button.png delete mode 100644 getting_started/first_2d_game/img/attach_node_window.png delete mode 100644 getting_started/first_2d_game/img/completed_main_scene.png delete mode 100644 getting_started/first_2d_game/img/custom_font1.png delete mode 100644 getting_started/first_2d_game/img/custom_font2.png delete mode 100644 getting_started/first_2d_game/img/custom_font3.png delete mode 100644 getting_started/first_2d_game/img/dodge_preview.gif delete mode 100644 getting_started/first_2d_game/img/draw_path2d.gif delete mode 100644 getting_started/first_2d_game/img/export_variable.png delete mode 100644 getting_started/first_2d_game/img/filesystem_dock.png delete mode 100644 getting_started/first_2d_game/img/folder-content.png delete mode 100644 getting_started/first_2d_game/img/grid_snap_button.png delete mode 100644 getting_started/first_2d_game/img/group_tab.png delete mode 100644 getting_started/first_2d_game/img/input-mapping-add-action.png delete mode 100644 getting_started/first_2d_game/img/input-mapping-add-key.png delete mode 100644 getting_started/first_2d_game/img/input-mapping-completed.png delete mode 100644 getting_started/first_2d_game/img/instance_scene.png delete mode 100644 getting_started/first_2d_game/img/lock_children.png delete mode 100644 getting_started/first_2d_game/img/main_scene_nodes.png delete mode 100644 getting_started/first_2d_game/img/mob_animations.gif delete mode 100644 getting_started/first_2d_game/img/new-project-button.png delete mode 100644 getting_started/first_2d_game/img/path2d_buttons.png delete mode 100644 getting_started/first_2d_game/img/player_coll_shape.png delete mode 100644 getting_started/first_2d_game/img/player_scale.png delete mode 100644 getting_started/first_2d_game/img/player_scene_nodes.png delete mode 100644 getting_started/first_2d_game/img/player_signal_connection.png delete mode 100644 getting_started/first_2d_game/img/player_signals.png delete mode 100644 getting_started/first_2d_game/img/set_collision_mask.png delete mode 100644 getting_started/first_2d_game/img/setting-project-width-and-height.png delete mode 100644 getting_started/first_2d_game/img/setting-stretch-mode.png delete mode 100644 getting_started/first_2d_game/img/spriteframes_panel.png delete mode 100644 getting_started/first_2d_game/img/spriteframes_panel2.png delete mode 100644 getting_started/first_2d_game/img/start_button_shortcut.png delete mode 100644 getting_started/first_2d_game/img/ui_anchor.png delete mode 100644 getting_started/first_2d_game/index.rst delete mode 100644 getting_started/first_3d_game/01.game_setup.rst delete mode 100644 getting_started/first_3d_game/02.player_input.rst delete mode 100644 getting_started/first_3d_game/03.player_movement_code.rst delete mode 100644 getting_started/first_3d_game/04.mob_scene.rst delete mode 100644 getting_started/first_3d_game/05.spawning_mobs.rst delete mode 100644 getting_started/first_3d_game/06.jump_and_squash.rst delete mode 100644 getting_started/first_3d_game/07.killing_player.rst delete mode 100644 getting_started/first_3d_game/08.score_and_replay.rst delete mode 100644 getting_started/first_3d_game/09.adding_animations.rst delete mode 100644 getting_started/first_3d_game/going_further.rst delete mode 100644 getting_started/first_3d_game/img/01.game_setup/01.import_button.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/02.browse_to_project_folder.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/03.import_and_edit.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/04.start_assets.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/05.main_node.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/06.staticbody_node.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/07.collision_shape_warning.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/08.create_box_shape.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/09.box_extents.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/10.mesh_instance.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/11.cube_mesh.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/12.cube_resized.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/13.move_gizmo_y_axis.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/14.select_mode_icon.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/15.translation_amount.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/16.turn_on_shadows.png delete mode 100644 getting_started/first_3d_game/img/01.game_setup/17.project_with_light.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/01.new_scene.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/02.instantiating_the_model.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/03.scene_structure.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/04.sphere_shape.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/05.moving_the_sphere_up.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/06.toggling_visibility.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/07.adding_action.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/07.input_map_tab.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/07.project_settings.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/08.actions_list_empty.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/08.create_key_action.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/09.keyboard_key_popup.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/09.keyboard_keys.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/10.joy_axis_option.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/11.joy_axis_popup.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/12.move_inputs_mapped.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/13.joy_button_option.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/14.add_jump_button.png delete mode 100644 getting_started/first_3d_game/img/02.player_input/14.jump_input_action.png delete mode 100644 getting_started/first_3d_game/img/03.player_movement_code/01.attach_script_to_player.png delete mode 100644 getting_started/first_3d_game/img/03.player_movement_code/02.clicking_main_tab.png delete mode 100644 getting_started/first_3d_game/img/03.player_movement_code/03.instance_child_scene.png delete mode 100644 getting_started/first_3d_game/img/03.player_movement_code/04.scene_tree_with_camera.png delete mode 100644 getting_started/first_3d_game/img/03.player_movement_code/05.camera_preview_checkbox.png delete mode 100644 getting_started/first_3d_game/img/03.player_movement_code/06.two_viewports.png delete mode 100644 getting_started/first_3d_game/img/03.player_movement_code/07.camera_preview_checkbox.png delete mode 100644 getting_started/first_3d_game/img/03.player_movement_code/08.camera_moved.png delete mode 100644 getting_started/first_3d_game/img/03.player_movement_code/09.camera_rotated.png delete mode 100644 getting_started/first_3d_game/img/03.player_movement_code/10.camera_perspective.png delete mode 100644 getting_started/first_3d_game/img/03.player_movement_code/11.camera_orthographic.png delete mode 100644 getting_started/first_3d_game/img/04.mob_scene/01.initial_three_nodes.png delete mode 100644 getting_started/first_3d_game/img/04.mob_scene/02.add_child_node.png delete mode 100644 getting_started/first_3d_game/img/04.mob_scene/03.scene_with_collision_shape.png delete mode 100644 getting_started/first_3d_game/img/04.mob_scene/04.create_box_shape.png delete mode 100644 getting_started/first_3d_game/img/04.mob_scene/05.box_final_size.png delete mode 100644 getting_started/first_3d_game/img/04.mob_scene/06.visibility_notifier.png delete mode 100644 getting_started/first_3d_game/img/04.mob_scene/07.visibility_notifier_bbox_resized.png delete mode 100644 getting_started/first_3d_game/img/04.mob_scene/08.mob_attach_script.png delete mode 100644 getting_started/first_3d_game/img/04.mob_scene/09.switch_to_3d_workspace.png delete mode 100644 getting_started/first_3d_game/img/04.mob_scene/10.node_dock.png delete mode 100644 getting_started/first_3d_game/img/04.mob_scene/11.connect_signal.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/01.monsters_path_preview.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/02.project_settings.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/03.window_settings.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/04.camera_preview.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/05.cylinders_node.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/06.cylinder_mesh.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/07.top_view.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/08.toggle_view_grid.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/09.toggle_grid_snap.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/10.place_first_cylinder.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/11.both_cylinders_selected.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/12.four_cylinders.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/13.selecting_all_cylinders.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/14.spatial_material.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/15.bright-cylinders.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/16.cylinders_fold.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/17.points_options.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/18.close_path.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/19.path_result.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/20.mob_scene_property.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/20.spawn_nodes.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/21.mob_timer.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/22.mob_timer_properties.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/23.timeout_signal.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/24.connect_timer_to_main.png delete mode 100644 getting_started/first_3d_game/img/05.spawning_mobs/25.spawn_result.png delete mode 100644 getting_started/first_3d_game/img/06.jump_and_squash/02.project_settings.png delete mode 100644 getting_started/first_3d_game/img/06.jump_and_squash/03.physics_layers.png delete mode 100644 getting_started/first_3d_game/img/06.jump_and_squash/04.default_physics_properties.png delete mode 100644 getting_started/first_3d_game/img/06.jump_and_squash/05.toggle_layer_and_mask.png delete mode 100644 getting_started/first_3d_game/img/06.jump_and_squash/06.named_checkboxes.png delete mode 100644 getting_started/first_3d_game/img/06.jump_and_squash/07.player_physics_mask.png delete mode 100644 getting_started/first_3d_game/img/06.jump_and_squash/08.mob_physics_mask.png delete mode 100644 getting_started/first_3d_game/img/06.jump_and_squash/09.groups_tab.png delete mode 100644 getting_started/first_3d_game/img/06.jump_and_squash/10.group_scene_icon.png delete mode 100644 getting_started/first_3d_game/img/07.killing_player/01.adding_area_node.png delete mode 100644 getting_started/first_3d_game/img/07.killing_player/02.cylinder_shape.png delete mode 100644 getting_started/first_3d_game/img/07.killing_player/03.cylinder_in_editor.png delete mode 100644 getting_started/first_3d_game/img/07.killing_player/04.mob_detector_properties.png delete mode 100644 getting_started/first_3d_game/img/07.killing_player/05.body_entered_signal.png delete mode 100644 getting_started/first_3d_game/img/07.killing_player/06.player_hit_signal.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/01.label_node.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/02.score_color_picker.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/02.score_custom_color.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/02.score_label_moved.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/02.score_placeholder.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/03.creating_theme.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/04.theme_preview.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/05.dynamic_font.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/06.font_data.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/07.font_size.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/08.open_main_script.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/09.score_in_game.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/10.layout_icon.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/11.full_rect_option.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/12.anchors_updated.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/13.retry_color_picker.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/14.retry_node.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/15.layout_center.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/16.new_scene.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/17.music_player_node.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/18.music_node_properties.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/19.register_autoload.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/20.scene_dock_tabs.png delete mode 100644 getting_started/first_3d_game/img/08.score_and_replay/21.remote_scene_tree.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/01.animation_player_dock.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/02.new_animation.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/03.float_name.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/03.timeline.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/04.autoplay_and_loop.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/05.pin_icon.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/06.animation_duration.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/07.editable_timeline.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/08.zoom_slider.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/09.creating_first_keyframe.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/10.initial_keys.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/11.moving_keys.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/12.second_keys_values.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/13.second_keys.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/14.play_button.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/15.box_select.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/16.easing_property.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/17.ease_out.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/18.ease_out_second_rotation_key.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/19.ease_in_second_translation_key.png delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/20.float_animation.gif delete mode 100644 getting_started/first_3d_game/img/09.adding_animations/21.script_icon.png delete mode 100644 getting_started/first_3d_game/img/squash-the-creeps-final.gif delete mode 100644 getting_started/first_3d_game/index.rst delete mode 100644 getting_started/introduction/introduction_to_godot.rst delete mode 100644 getting_started/introduction/learning_new_features.rst delete mode 100644 getting_started/step_by_step/scripting_languages.rst diff --git a/about/docs_changelog.rst b/about/docs_changelog.rst deleted file mode 100644 index 5f9ea44..0000000 --- a/about/docs_changelog.rst +++ /dev/null @@ -1,221 +0,0 @@ -.. _doc_docs_changelog: - -Documentation changelog -======================= - -The documentation is continually being improved. The release of version 3.2 -includes many new tutorials, many fixes and updates for old tutorials, and many updates -to the :ref:`class reference `. Below is a list of new tutorials -added since version 3.1. - -.. note:: This document only contains new tutorials so not all changes are reflected, - many tutorials have been substantially updated but are not reflected in this document. - -New tutorials since version 3.1 -------------------------------- - -Project workflow -^^^^^^^^^^^^^^^^ - -- :ref:`doc_android_custom_build` - -2D -^^ - -- :ref:`doc_2d_sprite_animation` - -Audio -^^^^^ - -- :ref:`doc_recording_with_microphone` -- :ref:`doc_sync_with_audio` - -Math -^^^^ - -- :ref:`doc_beziers_and_curves` -- :ref:`doc_interpolation` - -Inputs -^^^^^^ - -- :ref:`doc_input_examples` - -Internationalization -^^^^^^^^^^^^^^^^^^^^ - -- :ref:`doc_localization_using_gettext` - -Shading -^^^^^^^ - -- Your First Shader Series: - - :ref:`doc_introduction_to_shaders` - - :ref:`doc_your_first_canvasitem_shader` - - :ref:`doc_your_first_spatial_shader` - - :ref:`doc_your_second_spatial_shader` -- :ref:`doc_visual_shaders` - -Networking -^^^^^^^^^^ - -- :ref:`doc_webrtc` - -VR -^^ - -- :ref:`doc_vr_starter_tutorial_part_one` -- :ref:`doc_vr_starter_tutorial_part_two` - -Plugins -^^^^^^^ - -- :ref:`doc_android_plugin` -- :ref:`doc_inspector_plugins` -- :ref:`doc_visual_shader_plugins` - -Multi-threading -^^^^^^^^^^^^^^^ - -- :ref:`doc_using_multiple_threads` - -Creating content -^^^^^^^^^^^^^^^^ - -Procedural geometry series: - - :ref:`Procedural geometry ` - - :ref:`doc_arraymesh` - - :ref:`doc_surfacetool` - - :ref:`doc_meshdatatool` - - :ref:`doc_immediategeometry` - -Optimization -^^^^^^^^^^^^ - -- :ref:`doc_using_multimesh` -- :ref:`doc_using_servers` - -Legal -^^^^^ - -- :ref:`doc_complying_with_licenses` - -New tutorials since version 3.0 -------------------------------- - -Step by step -^^^^^^^^^^^^ - -- :ref:`doc_signals` -- :ref:`doc_exporting_basics` - -Scripting -^^^^^^^^^ - -- :ref:`doc_gdscript_static_typing` - -Project workflow -^^^^^^^^^^^^^^^^ - -Best Practices: - -- :ref:`doc_introduction_best_practices` -- :ref:`doc_what_are_godot_classes` -- :ref:`doc_scene_organization` -- :ref:`doc_scenes_versus_scripts` -- :ref:`doc_autoloads_versus_internal_nodes` -- :ref:`doc_node_alternatives` -- :ref:`doc_godot_interfaces` -- :ref:`doc_godot_notifications` -- :ref:`doc_data_preferences` -- :ref:`doc_logic_preferences` - -2D -^^ - -- :ref:`doc_2d_lights_and_shadows` -- :ref:`doc_2d_meshes` - -3D -^^ - -- :ref:`doc_csg_tools` -- :ref:`doc_animating_thousands_of_fish` -- :ref:`doc_controlling_thousands_of_fish` - -Physics -^^^^^^^ - -- :ref:`doc_ragdoll_system` -- :ref:`doc_soft_body` - -Animation -^^^^^^^^^ - -- :ref:`doc_2d_skeletons` -- :ref:`doc_animation_tree` - -GUI -^^^ - -- :ref:`doc_gui_containers` - -Viewports -^^^^^^^^^ - -- :ref:`doc_viewport_as_texture` -- :ref:`doc_custom_postprocessing` - -Shading -^^^^^^^ - -- :ref:`doc_converting_glsl_to_godot_shaders` -- :ref:`doc_advanced_postprocessing` - -Shading Reference: - -- :ref:`doc_introduction_to_shaders` -- :ref:`doc_shading_language` -- :ref:`doc_spatial_shader` -- :ref:`doc_canvas_item_shader` -- :ref:`doc_particle_shader` - -Plugins -^^^^^^^ - -- :ref:`doc_making_main_screen_plugins` -- :ref:`doc_spatial_gizmo_plugins` - -Platform-specific -^^^^^^^^^^^^^^^^^ - -- :ref:`doc_customizing_html5_shell` - -Multi-threading -^^^^^^^^^^^^^^^ - -- :ref:`doc_thread_safe_apis` - -Creating content -^^^^^^^^^^^^^^^^ - -- :ref:`doc_making_trees` - -Miscellaneous -^^^^^^^^^^^^^ - -- :ref:`doc_jitter_stutter` -- :ref:`doc_running_code_in_the_editor` -- :ref:`doc_change_scenes_manually` -- :ref:`doc_gles2_gles3_differences` - -Compiling -^^^^^^^^^ - -- :ref:`doc_optimizing_for_size` -- :ref:`doc_compiling_with_script_encryption_key` - -Engine development -^^^^^^^^^^^^^^^^^^ - -- :ref:`doc_binding_to_external_libraries` diff --git a/about/index.rst b/about/index.rst index 5a3f599..23b07bc 100644 --- a/about/index.rst +++ b/about/index.rst @@ -9,8 +9,6 @@ About faq troubleshooting list_of_features - docs_changelog - release_policy complying_with_licenses .. history diff --git a/about/release_policy.rst b/about/release_policy.rst deleted file mode 100644 index fc3f88e..0000000 --- a/about/release_policy.rst +++ /dev/null @@ -1,149 +0,0 @@ -.. _doc_release_policy: - -Godot release policy -==================== - -Godot's release policy is in constant evolution. What is described below is -intended to give a general idea of what to expect, but what will actually -happen depends on the choices of core contributors, and the needs of the -community at a given time. - -Godot versioning ----------------- - -Godot loosely follows `Semantic Versioning `__ with a -``major.minor.patch`` versioning system, albeit with an interpretation of each -term adapted to the complexity of a game engine: - -- The ``major`` version is incremented when major compatibility breakages happen - which imply significant porting work to move projects from one major version - to another. - - For example, porting Godot projects from Godot 2.1 to Godot 3.0 required - running the project through a conversion tool, and then performing a number - of further adjustments manually for what the tool could not do automatically. - -- The ``minor`` version is incremented for feature releases which do not break - compatibility in a major way. Minor compatibility breakage in very specific - areas *may* happen in minor versions, but the vast majority of projects - should not be affected or require significant porting work. - - The reason for this is that as a game engine, Godot covers many areas such - as rendering, physics, scripting, etc., and fixing bugs or implementing new - features in a given area may sometimes require changing the behavior of a - feature, or modifying the interface of a given class, even if the rest of - the engine API remains backwards compatible. - -.. tip:: - - Upgrading to a new minor version is therefore recommended for all users, - but some testing is necessary to ensure that your project still behaves as - expected in a new minor version. - -- The ``patch`` version is incremented for maintenance releases which focus on - fixing bugs and security issues, implementing new requirements for platform - support, and backporting safe usability enhancements. Patch releases are - backwards compatible. - - Patch versions may include minor new features which do not impact the - existing API, and thus have no risk of impacting existing projects. - -.. tip:: - - Updating to new patch versions is therefore considered safe and strongly - recommended to all users of a given stable branch. - -We call ``major.minor`` combinations *stable branches*. Each stable branch -starts with a ``major.minor`` release (without the ``0`` for ``patch``) and is -further developed for maintenance releases in a Git branch of the same name -(for example patch updates for the 3.3 stable branch are developed in the -``3.3`` Git branch). - -.. note:: - - As mentioned in the introduction, Godot's release policy is evolving, and - earlier Godot releases may not have followed the above rules to the letter. - In particular, the 3.2 stable branch received a number of new features in - 3.2.2 which would have warranted a ``minor`` version increment. - -Release support timeline ------------------------- - -Stable branches are supported *at minimum* until the next stable branch is -released and has received its first patch update. In practice, we support -stable branches on a *best effort* basis for as long as they have active users -who need maintenance updates. - -Whenever a new major version is released, we make the previous stable branch a -long-term supported release, and do our best to provide fixes for issues -encountered by users of that branch who cannot port complex projects to the new -major version. This was the case for the 2.1 branch, and will be the case for -the latest 3.x stable branch by the time Godot 4.0 is released. - -In a given minor release series, only the latest patch release receives support. -If you experience an issue using an older patch release, please upgrade to the -latest patch release of that series and test again before reporting an issue -on GitHub. - -+-------------+----------------------+--------------------------------------------------------------------------+ -| **Version** | **Release date** | **Support level** | -+-------------+----------------------+--------------------------------------------------------------------------+ -| Godot 4.0 | ~2022 (see below) | |unstable| *Current focus of development (unstable).* | -+-------------+----------------------+--------------------------------------------------------------------------+ -| Godot 3.5 | Q2 2022 | |supported| *Beta.* Receives new features as well as bug fixes while | -| | | under development. | -+-------------+----------------------+--------------------------------------------------------------------------+ -| Godot 3.4 | November 2021 | |supported| Receives fixes for bugs, security and platform support | -| | | issues, as well as backwards-compatible usability enhancements. | -+-------------+----------------------+--------------------------------------------------------------------------+ -| Godot 3.3 | April 2021 | |partial| Receives fixes for security and platform support issues only. | -+-------------+----------------------+--------------------------------------------------------------------------+ -| Godot 3.2 | January 2020 | |eol| No longer supported as fully superseded by the compatible 3.3 | -| | | release (last update: 3.2.3). | -+-------------+----------------------+--------------------------------------------------------------------------+ -| Godot 3.1 | March 2019 | |eol| No longer supported (last update: 3.1.2). | -+-------------+----------------------+--------------------------------------------------------------------------+ -| Godot 3.0 | January 2018 | |eol| No longer supported (last update: 3.0.6). | -+-------------+----------------------+--------------------------------------------------------------------------+ -| Godot 2.1 | July 2016 | |eol| No longer supported (last update: 2.1.6). | -+-------------+----------------------+--------------------------------------------------------------------------+ -| Godot 2.0 | February 2016 | |eol| No longer supported (last update: 2.0.4.1). | -+-------------+----------------------+--------------------------------------------------------------------------+ -| Godot 1.1 | May 2015 | |eol| No longer supported. | -+-------------+----------------------+--------------------------------------------------------------------------+ -| Godot 1.0 | December 2014 | |eol| No longer supported. | -+-------------+----------------------+--------------------------------------------------------------------------+ - -.. |supported| image:: img/supported.png -.. |partial| image:: img/partial.png -.. |eol| image:: img/eol.png -.. |unstable| image:: img/unstable.png - -**Legend:** -|supported| Full support – -|partial| Partial support – -|eol| No support (end of life) – -|unstable| Development version - -Pre-release Godot versions aren't intended to be used in production and are -provided for testing purposes only. - -.. _doc_release_policy_when_is_next_release_out: - -When is the next release out? ------------------------------ - -While Godot contributors aren't working under any deadlines, we have -historically had one major or minor release per year, with several maintenance -updates between each. - -Starting with Godot 3.3, we aim to accelerate our development cycles for minor -releases, so you can expect a new minor release every 3 to 6 months. - -Maintenance (patch) releases will be released as needed with potentially very -short development cycles, to provide users of the current stable branch with -the latest bug fixes for their production needs. - -As for the upcoming Godot 4.0, we can only say that we aim for a **2022** -release, but any closer estimate is likely to be hard to uphold. Alpha builds -will be published as soon as the main features for Godot 4.0 are finalized. diff --git a/getting_started/first_2d_game/01.project_setup.rst b/getting_started/first_2d_game/01.project_setup.rst deleted file mode 100644 index 84a88bf..0000000 --- a/getting_started/first_2d_game/01.project_setup.rst +++ /dev/null @@ -1,77 +0,0 @@ -.. _doc_your_first_2d_game_project_setup: - -Setting up the project -====================== - -In this short first part, we'll set up and organize the project. - -Launch Godot and create a new project. - -.. image:: img/new-project-button.png - -.. tabs:: - .. tab:: GDScript - - Download :download:`dodge_assets.zip `. - The archive contains the images and sounds you'll be using - to make the game. Extract the archive and move the ``art/`` - and ``fonts/`` directories to your project's directory. - - .. tab:: C# - - Download :download:`dodge_assets.zip `. - The archive contains the images and sounds you'll be using - to make the game. Extract the archive and move the ``art/`` - and ``fonts/`` directories to your project's directory. - - Ensure that you have the required dependencies to use C# in Godot. - You need the .NET Core 3.1 SDK, and an editor such as VS Code. - See :ref:`doc_c_sharp_setup`. - - .. tab:: GDNative C++ - - Download :download:`dodge_assets_with_gdnative.zip - `. - The archive contains the images and sounds you'll be using - to make the game. It also contains a starter GDNative project - including a ``SConstruct`` file, a ``dodge_the_creeps.gdnlib`` - file, a ``player.gdns`` file, and an ``entry.cpp`` file. - - Ensure that you have the required dependencies to use GDNative C++. - You need a C++ compiler such as GCC or Clang or MSVC that supports C++14. - On Windows you can download Visual Studio 2019 and select the C++ workload. - You also need SCons to use the build system (the SConstruct file). - Then you need to `download the Godot C++ bindings `_ - and place them in your project. - -Your project folder should look like this. - -.. image:: img/folder-content.png - -This game is designed for portrait mode, so we need to adjust the size of the -game window. Click on *Project -> Project Settings* to open the project settings -window and in the left column, open the *Display -> Window* tab. There, set -"Width" to ``480`` and "Height" to ``720``. - -.. image:: img/setting-project-width-and-height.png - -Also, scroll down to the bottom of the section and, under the "Stretch" options, -set ``Mode`` to "2d" and ``Aspect`` to "keep". This ensures that the game scales -consistently on different sized screens. - -.. image:: img/setting-stretch-mode.png - -Organizing the project -~~~~~~~~~~~~~~~~~~~~~~ - -In this project, we will make 3 independent scenes: ``Player``, ``Mob``, and -``HUD``, which we will combine into the game's ``Main`` scene. - -In a larger project, it might be useful to create folders to hold the various -scenes and their scripts, but for this relatively small game, you can save your -scenes and scripts in the project's root folder, identified by ``res://``. You -can see your project folders in the FileSystem dock in the lower left corner: - -.. image:: img/filesystem_dock.png - -With the project in place, we're ready to design the player scene in the next lesson. diff --git a/getting_started/first_2d_game/02.player_scene.rst b/getting_started/first_2d_game/02.player_scene.rst deleted file mode 100644 index b7d909e..0000000 --- a/getting_started/first_2d_game/02.player_scene.rst +++ /dev/null @@ -1,100 +0,0 @@ -.. _doc_your_first_2d_game_player_scene: - -Creating the player scene -========================= - -With the project settings in place, we can start working on the -player-controlled character. - -The first scene will define the ``Player`` object. One of the benefits of -creating a separate Player scene is that we can test it separately, even before -we've created other parts of the game. - -Node structure -~~~~~~~~~~~~~~ - -To begin, we need to choose a root node for the player object. As a general -rule, a scene's root node should reflect the object's desired functionality - -what the object *is*. Click the "Other Node" button and add an :ref:`Area2D -` node to the scene. - -.. image:: img/add_node.png - -Godot will display a warning icon next to the node in the scene tree. You can -ignore it for now. We will address it later. - -With ``Area2D`` we can detect objects that overlap or run into the player. -Change the node's name to ``Player`` by double-clicking on it. Now that we've -set the scene's root node, we can add additional nodes to give it more -functionality. - -Before we add any children to the ``Player`` node, we want to make sure we don't -accidentally move or resize them by clicking on them. Select the node and click -the icon to the right of the lock; its tooltip says "Makes sure the object's -children are not selectable." - -.. image:: img/lock_children.png - -Save the scene. Click Scene -> Save, or press :kbd:`Ctrl + S` on Windows/Linux -or :kbd:`Cmd + S` on macOS. - -.. note:: For this project, we will be following the Godot naming conventions. - - - **GDScript**: Classes (nodes) use PascalCase, variables and - functions use snake_case, and constants use ALL_CAPS (See - :ref:`doc_gdscript_styleguide`). - - - **C#**: Classes, export variables and methods use PascalCase, - private fields use _camelCase, local variables and parameters use - camelCase (See :ref:`doc_c_sharp_styleguide`). Be careful to type - the method names precisely when connecting signals. - - -Sprite animation -~~~~~~~~~~~~~~~~ - -Click on the ``Player`` node and add an :ref:`AnimatedSprite -` node as a child. The ``AnimatedSprite`` will handle the -appearance and animations for our player. Notice that there is a warning symbol -next to the node. An ``AnimatedSprite`` requires a :ref:`SpriteFrames -` resource, which is a list of the animations it can -display. To create one, find the ``Frames`` property in the Inspector and click -"[empty]" -> "New SpriteFrames". Click again to open the "SpriteFrames" panel: - -.. image:: img/spriteframes_panel.png - - -On the left is a list of animations. Click the "default" one and rename it to -"walk". Then click the "New Animation" button to create a second animation named -"up". Find the player images in the "FileSystem" tab - they're in the ``art`` -folder you unzipped earlier. Drag the two images for each animation, named -``playerGrey_up[1/2]`` and ``playerGrey_walk[1/2]``, into the "Animation Frames" -side of the panel for the corresponding animation: - -.. image:: img/spriteframes_panel2.png - -The player images are a bit too large for the game window, so we need to scale -them down. Click on the ``AnimatedSprite`` node and set the ``Scale`` property -to ``(0.5, 0.5)``. You can find it in the Inspector under the ``Node2D`` -heading. - -.. image:: img/player_scale.png - -Finally, add a :ref:`CollisionShape2D ` as a child of -``Player``. This will determine the player's "hitbox", or the bounds of its -collision area. For this character, a ``CapsuleShape2D`` node gives the best -fit, so next to "Shape" in the Inspector, click "[empty]"" -> "New -CapsuleShape2D". Using the two size handles, resize the shape to cover the -sprite: - -.. image:: img/player_coll_shape.png - -When you're finished, your ``Player`` scene should look like this: - -.. image:: img/player_scene_nodes.png - -Make sure to save the scene again after these changes. - -In the next part, we'll add a script to the player node to move and animate it. -Then, we'll set up collision detection to know when the player got hit by -something. diff --git a/getting_started/first_2d_game/03.coding_the_player.rst b/getting_started/first_2d_game/03.coding_the_player.rst deleted file mode 100644 index 8d0c8e2..0000000 --- a/getting_started/first_2d_game/03.coding_the_player.rst +++ /dev/null @@ -1,543 +0,0 @@ -.. _doc_your_first_2d_game_coding_the_player: - -Coding the player -================= - -In this lesson, we'll add player movement, animation, and set it up to detect -collisions. - -To do so, we need to add some functionality that we can't get from a built-in -node, so we'll add a script. Click the ``Player`` node and click the "Attach -Script" button: - -.. image:: img/add_script_button.png - -In the script settings window, you can leave the default settings alone. Just -click "Create": - -.. note:: If you're creating a C# script or other languages, select the language - from the `language` drop down menu before hitting create. - -.. image:: img/attach_node_window.png - -.. note:: If this is your first time encountering GDScript, please read - :ref:`doc_scripting` before continuing. - -Start by declaring the member variables this object will need: - -.. tabs:: - .. code-tab:: gdscript GDScript - - extends Area2D - - export var speed = 400 # How fast the player will move (pixels/sec). - var screen_size # Size of the game window. - - .. code-tab:: csharp - - using Godot; - using System; - - public class Player : Area2D - { - [Export] - public int Speed = 400; // How fast the player will move (pixels/sec). - - public Vector2 ScreenSize; // Size of the game window. - } - - .. code-tab:: cpp - - // A `player.gdns` file has already been created for you. Attach it to the Player node. - - // Create two files `player.cpp` and `player.hpp` next to `entry.cpp` in `src`. - // This code goes in `player.hpp`. We also define the methods we'll be using here. - #ifndef PLAYER_H - #define PLAYER_H - - #include - #include - #include - #include - #include - - class Player : public godot::Area2D { - GODOT_CLASS(Player, godot::Area2D) - - godot::AnimatedSprite *_animated_sprite; - godot::CollisionShape2D *_collision_shape; - godot::Input *_input; - godot::Vector2 _screen_size; // Size of the game window. - - public: - real_t speed = 400; // How fast the player will move (pixels/sec). - - void _init() {} - void _ready(); - void _process(const double p_delta); - void start(const godot::Vector2 p_position); - void _on_Player_body_entered(godot::Node2D *_body); - - static void _register_methods(); - }; - - #endif // PLAYER_H - -Using the ``export`` keyword on the first variable ``speed`` allows us to set -its value in the Inspector. This can be handy for values that you want to be -able to adjust just like a node's built-in properties. Click on the ``Player`` -node and you'll see the property now appears in the "Script Variables" section -of the Inspector. Remember, if you change the value here, it will override the -value written in the script. - -.. warning:: If you're using C#, you need to (re)build the project assemblies - whenever you want to see new export variables or signals. This - build can be manually triggered by clicking the word "Mono" at the - bottom of the editor window to reveal the Mono Panel, then clicking - the "Build Project" button. - -.. image:: img/export_variable.png - -The ``_ready()`` function is called when a node enters the scene tree, which is -a good time to find the size of the game window: - -.. tabs:: - .. code-tab:: gdscript GDScript - - func _ready(): - screen_size = get_viewport_rect().size - - .. code-tab:: csharp - - public override void _Ready() - { - ScreenSize = GetViewportRect().Size; - } - - .. code-tab:: cpp - - // This code goes in `player.cpp`. - #include "player.hpp" - - void Player::_ready() { - _animated_sprite = get_node("AnimatedSprite"); - _collision_shape = get_node("CollisionShape2D"); - _input = godot::Input::get_singleton(); - _screen_size = get_viewport_rect().size; - } - -Now we can use the ``_process()`` function to define what the player will do. -``_process()`` is called every frame, so we'll use it to update elements of our -game, which we expect will change often. For the player, we need to do the -following: - -- Check for input. -- Move in the given direction. -- Play the appropriate animation. - -First, we need to check for input - is the player pressing a key? For this game, -we have 4 direction inputs to check. Input actions are defined in the Project -Settings under "Input Map". Here, you can define custom events and assign -different keys, mouse events, or other inputs to them. For this game, we will -map the arrow keys to the four directions. - -Click on *Project -> Project Settings* to open the project settings window and -click on the *Input Map* tab at the top. Type "move_right" in the top bar and -click the "Add" button to add the ``move_right`` action. - -.. image:: img/input-mapping-add-action.png - -We need to assign a key to this action. Click the "+" icon on the right, then -click the "Key" option in the drop-down menu. A dialog asks you to type in the -desired key. Press the right arrow on your keyboard and click "Ok". - -.. image:: img/input-mapping-add-key.png - -Repeat these steps to add three more mappings: - -1. ``move_left`` mapped to the left arrow key. -2. ``move_up`` mapped to the up arrow key. -3. And ``move_down`` mapped to the down arrow key. - -Your input map tab should look like this: - -.. image:: img/input-mapping-completed.png - -Click the "Close" button to close the project settings. - -.. note:: - - We only mapped one key to each input action, but you can map multiple keys, - joystick buttons, or mouse buttons to the same input action. - -You can detect whether a key is pressed using ``Input.is_action_pressed()``, -which returns ``true`` if it's pressed or ``false`` if it isn't. - -.. tabs:: - .. code-tab:: gdscript GDScript - - func _process(delta): - var velocity = Vector2.ZERO # The player's movement vector. - if Input.is_action_pressed("move_right"): - velocity.x += 1 - if Input.is_action_pressed("move_left"): - velocity.x -= 1 - if Input.is_action_pressed("move_down"): - velocity.y += 1 - if Input.is_action_pressed("move_up"): - velocity.y -= 1 - - if velocity.length() > 0: - velocity = velocity.normalized() * speed - $AnimatedSprite.play() - else: - $AnimatedSprite.stop() - - .. code-tab:: csharp - - public override void _Process(float delta) - { - var velocity = Vector2.Zero; // The player's movement vector. - - if (Input.IsActionPressed("move_right")) - { - velocity.x += 1; - } - - if (Input.IsActionPressed("move_left")) - { - velocity.x -= 1; - } - - if (Input.IsActionPressed("move_down")) - { - velocity.y += 1; - } - - if (Input.IsActionPressed("move_up")) - { - velocity.y -= 1; - } - - var animatedSprite = GetNode("AnimatedSprite"); - - if (velocity.Length() > 0) - { - velocity = velocity.Normalized() * Speed; - animatedSprite.Play(); - } - else - { - animatedSprite.Stop(); - } - } - - .. code-tab:: cpp - - // This code goes in `player.cpp`. - void Player::_process(const double p_delta) { - godot::Vector2 velocity(0, 0); - - velocity.x = _input->get_action_strength("move_right") - _input->get_action_strength("move_left"); - velocity.y = _input->get_action_strength("move_down") - _input->get_action_strength("move_up"); - - if (velocity.length() > 0) { - velocity = velocity.normalized() * speed; - _animated_sprite->play(); - } else { - _animated_sprite->stop(); - } - } - -We start by setting the ``velocity`` to ``(0, 0)`` - by default, the player -should not be moving. Then we check each input and add/subtract from the -``velocity`` to obtain a total direction. For example, if you hold ``right`` and -``down`` at the same time, the resulting ``velocity`` vector will be ``(1, 1)``. -In this case, since we're adding a horizontal and a vertical movement, the -player would move *faster* diagonally than if it just moved horizontally. - -We can prevent that if we *normalize* the velocity, which means we set its -*length* to ``1``, then multiply by the desired speed. This means no more fast -diagonal movement. - -.. tip:: If you've never used vector math before, or need a refresher, you can - see an explanation of vector usage in Godot at :ref:`doc_vector_math`. - It's good to know but won't be necessary for the rest of this tutorial. - -We also check whether the player is moving so we can call ``play()`` or -``stop()`` on the AnimatedSprite. - - ``$`` is shorthand for ``get_node()``. So in the code above, - ``$AnimatedSprite.play()`` is the same as - ``get_node("AnimatedSprite").play()``. - -.. tip:: In GDScript, ``$`` returns the node at the relative path from the - current node, or returns ``null`` if the node is not found. Since - AnimatedSprite is a child of the current node, we can use - ``$AnimatedSprite``. - -Now that we have a movement direction, we can update the player's position. We -can also use ``clamp()`` to prevent it from leaving the screen. *Clamping* a -value means restricting it to a given range. Add the following to the bottom of -the ``_process`` function (make sure it's not indented under the `else`): - -.. tabs:: - .. code-tab:: gdscript GDScript - - position += velocity * delta - position.x = clamp(position.x, 0, screen_size.x) - position.y = clamp(position.y, 0, screen_size.y) - - .. code-tab:: csharp - - Position += velocity * delta; - Position = new Vector2( - x: Mathf.Clamp(Position.x, 0, ScreenSize.x), - y: Mathf.Clamp(Position.y, 0, ScreenSize.y) - ); - - .. code-tab:: cpp - - godot::Vector2 position = get_position(); - position += velocity * (real_t)p_delta; - position.x = godot::Math::clamp(position.x, (real_t)0.0, _screen_size.x); - position.y = godot::Math::clamp(position.y, (real_t)0.0, _screen_size.y); - set_position(position); - -.. tip:: The `delta` parameter in the `_process()` function refers to the *frame - length* - the amount of time that the previous frame took to complete. - Using this value ensures that your movement will remain consistent even - if the frame rate changes. - -Click "Play Scene" (:kbd:`F6`, :kbd:`Cmd + R` on macOS) and confirm you can move -the player around the screen in all directions. - -.. warning:: If you get an error in the "Debugger" panel that says - - ``Attempt to call function 'play' in base 'null instance' on a null - instance`` - - this likely means you spelled the name of the AnimatedSprite node - wrong. Node names are case-sensitive and ``$NodeName`` must match - the name you see in the scene tree. - -Choosing animations -~~~~~~~~~~~~~~~~~~~ - -Now that the player can move, we need to change which animation the -AnimatedSprite is playing based on its direction. We have the "walk" animation, -which shows the player walking to the right. This animation should be flipped -horizontally using the ``flip_h`` property for left movement. We also have the -"up" animation, which should be flipped vertically with ``flip_v`` for downward -movement. Let's place this code at the end of the ``_process()`` function: - -.. tabs:: - .. code-tab:: gdscript GDScript - - if velocity.x != 0: - $AnimatedSprite.animation = "walk" - $AnimatedSprite.flip_v = false - # See the note below about boolean assignment. - $AnimatedSprite.flip_h = velocity.x < 0 - elif velocity.y != 0: - $AnimatedSprite.animation = "up" - $AnimatedSprite.flip_v = velocity.y > 0 - - .. code-tab:: csharp - - if (velocity.x != 0) - { - animatedSprite.Animation = "walk"; - animatedSprite.FlipV = false; - // See the note below about boolean assignment. - animatedSprite.FlipH = velocity.x < 0; - } - else if (velocity.y != 0) - { - animatedSprite.Animation = "up"; - animatedSprite.FlipV = velocity.y > 0; - } - - .. code-tab:: cpp - - if (velocity.x != 0) { - _animated_sprite->set_animation("right"); - _animated_sprite->set_flip_v(false); - // See the note below about boolean assignment. - _animated_sprite->set_flip_h(velocity.x < 0); - } else if (velocity.y != 0) { - _animated_sprite->set_animation("up"); - _animated_sprite->set_flip_v(velocity.y > 0); - } - -.. Note:: The boolean assignments in the code above are a common shorthand for - programmers. Since we're doing a comparison test (boolean) and also - *assigning* a boolean value, we can do both at the same time. Consider - this code versus the one-line boolean assignment above: - - .. tabs:: - .. code-tab :: gdscript GDScript - - if velocity.x < 0: - $AnimatedSprite.flip_h = true - else: - $AnimatedSprite.flip_h = false - - .. code-tab:: csharp - - if (velocity.x < 0) - { - animatedSprite.FlipH = true; - } - else - { - animatedSprite.FlipH = false; - } - -Play the scene again and check that the animations are correct in each of the -directions. - -.. tip:: A common mistake here is to type the names of the animations wrong. The - animation names in the SpriteFrames panel must match what you type in - the code. If you named the animation ``"Walk"``, you must also use a - capital "W" in the code. - -When you're sure the movement is working correctly, add this line to -``_ready()``, so the player will be hidden when the game starts: - -.. tabs:: - .. code-tab:: gdscript GDScript - - hide() - - .. code-tab:: csharp - - Hide(); - - .. code-tab:: cpp - - hide(); - -Preparing for collisions -~~~~~~~~~~~~~~~~~~~~~~~~ - -We want ``Player`` to detect when it's hit by an enemy, but we haven't made any -enemies yet! That's OK, because we're going to use Godot's *signal* -functionality to make it work. - -Add the following at the top of the script, after ``extends Area2D``: - -.. tabs:: - .. code-tab:: gdscript GDScript - - signal hit - - .. code-tab:: csharp - - // Don't forget to rebuild the project so the editor knows about the new signal. - - [Signal] - public delegate void Hit(); - - .. code-tab:: cpp - - // This code goes in `player.cpp`. - // We need to register the signal here, and while we're here, we can also - // register the other methods and register the speed property. - void Player::_register_methods() { - godot::register_method("_ready", &Player::_ready); - godot::register_method("_process", &Player::_process); - godot::register_method("start", &Player::start); - godot::register_method("_on_Player_body_entered", &Player::_on_Player_body_entered); - godot::register_property("speed", &Player::speed, (real_t)400.0); - // This below line is the signal. - godot::register_signal("hit", godot::Dictionary()); - } - -This defines a custom signal called "hit" that we will have our player emit -(send out) when it collides with an enemy. We will use ``Area2D`` to detect the -collision. Select the ``Player`` node and click the "Node" tab next to the -Inspector tab to see the list of signals the player can emit: - -.. image:: img/player_signals.png - -Notice our custom "hit" signal is there as well! Since our enemies are going to -be ``RigidBody2D`` nodes, we want the ``body_entered(body: Node)`` signal. This -signal will be emitted when a body contacts the player. Click "Connect.." and -the "Connect a Signal" window appears. We don't need to change any of these -settings so click "Connect" again. Godot will automatically create a function in -your player's script. - -.. image:: img/player_signal_connection.png - -Note the green icon indicating that a signal is connected to this function. Add -this code to the function: - -.. tabs:: - .. code-tab:: gdscript GDScript - - func _on_Player_body_entered(body): - hide() # Player disappears after being hit. - emit_signal("hit") - # Must be deferred as we can't change physics properties on a physics callback. - $CollisionShape2D.set_deferred("disabled", true) - - .. code-tab:: csharp - - public void OnPlayerBodyEntered(PhysicsBody2D body) - { - Hide(); // Player disappears after being hit. - EmitSignal(nameof(Hit)); - // Must be deferred as we can't change physics properties on a physics callback. - GetNode("CollisionShape2D").SetDeferred("disabled", true); - } - - .. code-tab:: cpp - - // This code goes in `player.cpp`. - void Player::_on_Player_body_entered(godot::Node2D *_body) { - hide(); // Player disappears after being hit. - emit_signal("hit"); - // Must be deferred as we can't change physics properties on a physics callback. - _collision_shape->set_deferred("disabled", true); - } - -Each time an enemy hits the player, the signal is going to be emitted. We need -to disable the player's collision so that we don't trigger the ``hit`` signal -more than once. - -.. Note:: Disabling the area's collision shape can cause an error if it happens - in the middle of the engine's collision processing. Using - ``set_deferred()`` tells Godot to wait to disable the shape until it's - safe to do so. - -The last piece is to add a function we can call to reset the player when -starting a new game. - -.. tabs:: - .. code-tab:: gdscript GDScript - - func start(pos): - position = pos - show() - $CollisionShape2D.disabled = false - - .. code-tab:: csharp - - public void Start(Vector2 pos) - { - Position = pos; - Show(); - GetNode("CollisionShape2D").Disabled = false; - } - - .. code-tab:: cpp - - // This code goes in `player.cpp`. - void Player::start(const godot::Vector2 p_position) { - set_position(p_position); - show(); - _collision_shape->set_disabled(false); - } - -With the player working, we'll work on the enemy in the next lesson. diff --git a/getting_started/first_2d_game/04.creating_the_enemy.rst b/getting_started/first_2d_game/04.creating_the_enemy.rst deleted file mode 100644 index 23e1848..0000000 --- a/getting_started/first_2d_game/04.creating_the_enemy.rst +++ /dev/null @@ -1,180 +0,0 @@ -.. _doc_your_first_2d_game_creating_the_enemy: - -Creating the enemy -================== - -Now it's time to make the enemies our player will have to dodge. Their behavior -will not be very complex: mobs will spawn randomly at the edges of the screen, -choose a random direction, and move in a straight line. - -We'll create a ``Mob`` scene, which we can then *instance* to create any number -of independent mobs in the game. - -Node setup -~~~~~~~~~~ - -Click Scene -> New Scene and add the following nodes: - -- :ref:`RigidBody2D ` (named ``Mob``) - - - :ref:`AnimatedSprite ` - - :ref:`CollisionShape2D ` - - :ref:`VisibilityNotifier2D ` - -Don't forget to set the children so they can't be selected, like you did with -the Player scene. - -In the :ref:`RigidBody2D ` properties, set ``Gravity Scale`` -to ``0``, so the mob will not fall downward. In addition, under the -:ref:`CollisionObject2D ` section, click the ``Mask`` property and uncheck the first -box. This will ensure the mobs do not collide with each other. - -.. image:: img/set_collision_mask.png - -Set up the :ref:`AnimatedSprite ` like you did for the -player. This time, we have 3 animations: ``fly``, ``swim``, and ``walk``. There -are two images for each animation in the art folder. - -Adjust the "Speed (FPS)" to ``3`` for all animations. - -.. image:: img/mob_animations.gif - -Set the ``Playing`` property in the Inspector to "On". - -We'll select one of these animations randomly so that the mobs will have some -variety. - -Like the player images, these mob images need to be scaled down. Set the -``AnimatedSprite``'s ``Scale`` property to ``(0.75, 0.75)``. - -As in the ``Player`` scene, add a ``CapsuleShape2D`` for the collision. To align -the shape with the image, you'll need to set the ``Rotation Degrees`` property -to ``90`` (under "Transform" in the Inspector). - -Save the scene. - -Enemy script -~~~~~~~~~~~~ - -Add a script to the ``Mob`` like this: - -.. tabs:: - .. code-tab:: gdscript GDScript - - extends RigidBody2D - - .. code-tab:: csharp - - public class Mob : RigidBody2D - { - // Don't forget to rebuild the project. - } - - .. code-tab:: cpp - - // Copy `player.gdns` to `mob.gdns` and replace `Player` with `Mob`. - // Attach the `mob.gdns` file to the Mob node. - - // Create two files `mob.cpp` and `mob.hpp` next to `entry.cpp` in `src`. - // This code goes in `mob.hpp`. We also define the methods we'll be using here. - #ifndef MOB_H - #define MOB_H - - #include - #include - #include - - class Mob : public godot::RigidBody2D { - GODOT_CLASS(Mob, godot::RigidBody2D) - - godot::AnimatedSprite *_animated_sprite; - - public: - void _init() {} - void _ready(); - void _on_VisibilityNotifier2D_screen_exited(); - - static void _register_methods(); - }; - - #endif // MOB_H - -Now let's look at the rest of the script. In ``_ready()`` we play the animation -and randomly choose one of the three animation types: - -.. tabs:: - .. code-tab:: gdscript GDScript - - func _ready(): - $AnimatedSprite.playing = true - var mob_types = $AnimatedSprite.frames.get_animation_names() - $AnimatedSprite.animation = mob_types[randi() % mob_types.size()] - - .. code-tab:: csharp - - public override void _Ready() - { - var animSprite = GetNode("AnimatedSprite"); - animSprite.Playing = true; - string[] mobTypes = animSprite.Frames.GetAnimationNames(); - animSprite.Animation = mobTypes[GD.Randi() % mobTypes.Length]; - } - - .. code-tab:: cpp - - // This code goes in `mob.cpp`. - #include "mob.hpp" - - #include - #include - - void Mob::_ready() { - godot::Ref random = godot::RandomNumberGenerator::_new(); - random->randomize(); - _animated_sprite = get_node("AnimatedSprite"); - _animated_sprite->_set_playing(true); - godot::PoolStringArray mob_types = _animated_sprite->get_sprite_frames()->get_animation_names(); - _animated_sprite->set_animation(mob_types[random->randi() % mob_types.size()]); - } - -First, we get the list of animation names from the AnimatedSprite's ``frames`` -property. This returns an Array containing all three animation names: ``["walk", -"swim", "fly"]``. - -We then need to pick a random number between ``0`` and ``2`` to select one of -these names from the list (array indices start at ``0``). ``randi() % n`` -selects a random integer between ``0`` and ``n-1``. - -.. note:: You must use ``randomize()`` if you want your sequence of "random" - numbers to be different every time you run the scene. We're going to - use ``randomize()`` in our ``Main`` scene, so we won't need it here. - -The last piece is to make the mobs delete themselves when they leave the screen. -Connect the ``screen_exited()`` signal of the ``VisibilityNotifier2D`` node and -add this code: - -.. tabs:: - .. code-tab:: gdscript GDScript - - func _on_VisibilityNotifier2D_screen_exited(): - queue_free() - - .. code-tab:: csharp - - public void OnVisibilityNotifier2DScreenExited() - { - QueueFree(); - } - - .. code-tab:: cpp - - // This code goes in `mob.cpp`. - void Mob::_on_VisibilityNotifier2D_screen_exited() { - queue_free(); - } - -This completes the `Mob` scene. - -With the player and enemies ready, in the next part, we'll bring them together -in a new scene. We'll make enemies spawn randomly around the game board and move -forward, turning our project into a playable game. diff --git a/getting_started/first_2d_game/05.the_main_game_scene.rst b/getting_started/first_2d_game/05.the_main_game_scene.rst deleted file mode 100644 index bd9c301..0000000 --- a/getting_started/first_2d_game/05.the_main_game_scene.rst +++ /dev/null @@ -1,452 +0,0 @@ -.. _doc_your_first_2d_game_the_main_game_scene: - -The main game scene -=================== - -Now it's time to bring everything we did together into a playable game scene. - -Create a new scene and add a :ref:`Node ` named ``Main``. Ensure you -create a Node, **not** a Node2D. Click the "Instance" button and select your -saved ``Player.tscn``. - -.. image:: img/instance_scene.png - -Now, add the following nodes as children of ``Main``, and name them as shown -(values are in seconds): - -- :ref:`Timer ` (named ``MobTimer``) - to control how often mobs - spawn -- :ref:`Timer ` (named ``ScoreTimer``) - to increment the score - every second -- :ref:`Timer ` (named ``StartTimer``) - to give a delay before - starting -- :ref:`Position2D ` (named ``StartPosition``) - to indicate - the player's start position - -Set the ``Wait Time`` property of each of the ``Timer`` nodes as follows: - -- ``MobTimer``: ``0.5`` -- ``ScoreTimer``: ``1`` -- ``StartTimer``: ``2`` - -In addition, set the ``One Shot`` property of ``StartTimer`` to "On" and set -``Position`` of the ``StartPosition`` node to ``(240, 450)``. - -Spawning mobs -~~~~~~~~~~~~~ - -The Main node will be spawning new mobs, and we want them to appear at a random -location on the edge of the screen. Add a :ref:`Path2D ` node -named ``MobPath`` as a child of ``Main``. When you select ``Path2D``, you will -see some new buttons at the top of the editor: - -.. image:: img/path2d_buttons.png - -Select the middle one ("Add Point") and draw the path by clicking to add the -points at the corners shown. To have the points snap to the grid, make sure "Use -Grid Snap" and "Use Snap" are both selected. These options can be found to the -left of the "Lock" button, appearing as a magnet next to some dots and -intersecting lines, respectively. - -.. image:: img/grid_snap_button.png - -.. important:: Draw the path in *clockwise* order, or your mobs will spawn - pointing *outwards* instead of *inwards*! - -.. image:: img/draw_path2d.gif - -After placing point ``4`` in the image, click the "Close Curve" button and your -curve will be complete. - -Now that the path is defined, add a :ref:`PathFollow2D ` -node as a child of ``MobPath`` and name it ``MobSpawnLocation``. This node will -automatically rotate and follow the path as it moves, so we can use it to select -a random position and direction along the path. - -Your scene should look like this: - -.. image:: img/main_scene_nodes.png - -Main script -~~~~~~~~~~~ - -Add a script to ``Main``. At the top of the script, we use ``export -(PackedScene)`` to allow us to choose the Mob scene we want to instance. - -.. tabs:: - .. code-tab:: gdscript GDScript - - extends Node - - export(PackedScene) var mob_scene - var score - - .. code-tab:: csharp - - public class Main : Node - { - // Don't forget to rebuild the project so the editor knows about the new export variable. - - #pragma warning disable 649 - // We assign this in the editor, so we don't need the warning about not being assigned. - [Export] - public PackedScene MobScene; - #pragma warning restore 649 - - public int Score; - } - - .. code-tab:: cpp - - // Copy `player.gdns` to `main.gdns` and replace `Player` with `Main`. - // Attach the `main.gdns` file to the Main node. - - // Create two files `main.cpp` and `main.hpp` next to `entry.cpp` in `src`. - // This code goes in `main.hpp`. We also define the methods we'll be using here. - #ifndef MAIN_H - #define MAIN_H - - #include - #include - #include - #include - #include - #include - #include - #include - - #include "hud.hpp" - #include "player.hpp" - - class Main : public godot::Node { - GODOT_CLASS(Main, godot::Node) - - int score; - HUD *_hud; - Player *_player; - godot::Node2D *_start_position; - godot::PathFollow2D *_mob_spawn_location; - godot::Timer *_mob_timer; - godot::Timer *_score_timer; - godot::Timer *_start_timer; - godot::AudioStreamPlayer *_music; - godot::AudioStreamPlayer *_death_sound; - godot::Ref _random; - - public: - godot::Ref mob_scene; - - void _init() {} - void _ready(); - void game_over(); - void new_game(); - void _on_MobTimer_timeout(); - void _on_ScoreTimer_timeout(); - void _on_StartTimer_timeout(); - - static void _register_methods(); - }; - - #endif // MAIN_H - -We also add a call to ``randomize()`` here so that the random number -generator generates different random numbers each time the game is run: - -.. tabs:: - .. code-tab:: gdscript GDScript - - func _ready(): - randomize() - - .. code-tab:: csharp - - public override void _Ready() - { - GD.Randomize(); - } - - .. code-tab:: cpp - - // This code goes in `main.cpp`. - #include "main.hpp" - - #include - - #include "mob.hpp" - - void Main::_ready() { - _hud = get_node("HUD"); - _player = get_node("Player"); - _start_position = get_node("StartPosition"); - _mob_spawn_location = get_node("MobPath/MobSpawnLocation"); - _mob_timer = get_node("MobTimer"); - _score_timer = get_node("ScoreTimer"); - _start_timer = get_node("StartTimer"); - // Uncomment these after adding the nodes in the "Sound effects" section of "Finishing up". - //_music = get_node("Music"); - //_death_sound = get_node("DeathSound"); - _random = (godot::Ref)godot::RandomNumberGenerator::_new(); - _random->randomize(); - } - -Click the ``Main`` node and you will see the ``Mob Scene`` property in the Inspector -under "Script Variables". - -You can assign this property's value in two ways: - -- Drag ``Mob.tscn`` from the "FileSystem" panel and drop it in the ``Mob`` - property . -- Click the down arrow next to "[empty]" and choose "Load". Select ``Mob.tscn``. - -Next, select the ``Player`` node in the Scene dock, and access the Node dock on -the sidebar. Make sure to have the Signals tab selected in the Node dock. - -You should see a list of the signals for the ``Player`` node. Find and -double-click the ``hit`` signal in the list (or right-click it and select -"Connect..."). This will open the signal connection dialog. We want to make a -new function named ``game_over``, which will handle what needs to happen when a -game ends. Type "game_over" in the "Receiver Method" box at the bottom of the -signal connection dialog and click "Connect". Add the following code to the new -function, as well as a ``new_game`` function that will set everything up for a -new game: - -.. tabs:: - .. code-tab:: gdscript GDScript - - func game_over(): - $ScoreTimer.stop() - $MobTimer.stop() - - func new_game(): - score = 0 - $Player.start($StartPosition.position) - $StartTimer.start() - - .. code-tab:: csharp - - public void GameOver() - { - GetNode("MobTimer").Stop(); - GetNode("ScoreTimer").Stop(); - } - - public void NewGame() - { - Score = 0; - - var player = GetNode("Player"); - var startPosition = GetNode("StartPosition"); - player.Start(startPosition.Position); - - GetNode("StartTimer").Start(); - } - - .. code-tab:: cpp - - // This code goes in `main.cpp`. - void Main::game_over() { - _score_timer->stop(); - _mob_timer->stop(); - } - - void Main::new_game() { - score = 0; - _player->start(_start_position->get_position()); - _start_timer->start(); - } - -Now connect the ``timeout()`` signal of each of the Timer nodes (``StartTimer``, -``ScoreTimer`` , and ``MobTimer``) to the main script. ``StartTimer`` will start -the other two timers. ``ScoreTimer`` will increment the score by 1. - -.. tabs:: - .. code-tab:: gdscript GDScript - - func _on_ScoreTimer_timeout(): - score += 1 - - func _on_StartTimer_timeout(): - $MobTimer.start() - $ScoreTimer.start() - - .. code-tab:: csharp - - public void OnScoreTimerTimeout() - { - Score++; - } - - public void OnStartTimerTimeout() - { - GetNode("MobTimer").Start(); - GetNode("ScoreTimer").Start(); - } - - .. code-tab:: cpp - - // This code goes in `main.cpp`. - void Main::_on_ScoreTimer_timeout() { - score += 1; - } - - void Main::_on_StartTimer_timeout() { - _mob_timer->start(); - _score_timer->start(); - } - - // Also add this to register all methods and the mob scene property. - void Main::_register_methods() { - godot::register_method("_ready", &Main::_ready); - godot::register_method("game_over", &Main::game_over); - godot::register_method("new_game", &Main::new_game); - godot::register_method("_on_MobTimer_timeout", &Main::_on_MobTimer_timeout); - godot::register_method("_on_ScoreTimer_timeout", &Main::_on_ScoreTimer_timeout); - godot::register_method("_on_StartTimer_timeout", &Main::_on_StartTimer_timeout); - godot::register_property("mob_scene", &Main::mob_scene, (godot::Ref)nullptr); - } - -In ``_on_MobTimer_timeout()``, we will create a mob instance, pick a random -starting location along the ``Path2D``, and set the mob in motion. The -``PathFollow2D`` node will automatically rotate as it follows the path, so we -will use that to select the mob's direction as well as its position. -When we spawn a mob, we'll pick a random value between ``150.0`` and -``250.0`` for how fast each mob will move (it would be boring if they were -all moving at the same speed). - -Note that a new instance must be added to the scene using ``add_child()``. - -.. tabs:: - .. code-tab:: gdscript GDScript - - func _on_MobTimer_timeout(): - # Create a new instance of the Mob scene. - var mob = mob_scene.instance() - - # Choose a random location on Path2D. - var mob_spawn_location = get_node("MobPath/MobSpawnLocation") - mob_spawn_location.offset = randi() - - # Set the mob's direction perpendicular to the path direction. - var direction = mob_spawn_location.rotation + PI / 2 - - # Set the mob's position to a random location. - mob.position = mob_spawn_location.position - - # Add some randomness to the direction. - direction += rand_range(-PI / 4, PI / 4) - mob.rotation = direction - - # Choose the velocity for the mob. - var velocity = Vector2(rand_range(150.0, 250.0), 0.0) - mob.linear_velocity = velocity.rotated(direction) - - # Spawn the mob by adding it to the Main scene. - add_child(mob) - - .. code-tab:: csharp - - public void OnMobTimerTimeout() - { - // Note: Normally it is best to use explicit types rather than the `var` - // keyword. However, var is acceptable to use here because the types are - // obviously Mob and PathFollow2D, since they appear later on the line. - - // Create a new instance of the Mob scene. - var mob = (Mob)MobScene.Instance(); - - // Choose a random location on Path2D. - var mobSpawnLocation = GetNode("MobPath/MobSpawnLocation"); - mobSpawnLocation.Offset = GD.Randi(); - - // Set the mob's direction perpendicular to the path direction. - float direction = mobSpawnLocation.Rotation + Mathf.Pi / 2; - - // Set the mob's position to a random location. - mob.Position = mobSpawnLocation.Position; - - // Add some randomness to the direction. - direction += (float)GD.RandRange(-Mathf.Pi / 4, Mathf.Pi / 4); - mob.Rotation = direction; - - // Choose the velocity. - var velocity = new Vector2((float)GD.RandRange(150.0, 250.0), 0); - mob.LinearVelocity = velocity.Rotated(direction); - - // Spawn the mob by adding it to the Main scene. - AddChild(mob); - } - - .. code-tab:: cpp - - // This code goes in `main.cpp`. - void Main::_on_MobTimer_timeout() { - // Create a new instance of the Mob scene. - godot::Node *mob = mob_scene->instance(); - - // Choose a random location on Path2D. - _mob_spawn_location->set_offset((real_t)_random->randi()); - - // Set the mob's direction perpendicular to the path direction. - real_t direction = _mob_spawn_location->get_rotation() + (real_t)Math_PI / 2; - - // Set the mob's position to a random location. - mob->set("position", _mob_spawn_location->get_position()); - - // Add some randomness to the direction. - direction += _random->randf_range((real_t)-Math_PI / 4, (real_t)Math_PI / 4); - mob->set("rotation", direction); - - // Choose the velocity for the mob. - godot::Vector2 velocity = godot::Vector2(_random->randf_range(150.0, 250.0), 0.0); - mob->set("linear_velocity", velocity.rotated(direction)); - - // Spawn the mob by adding it to the Main scene. - add_child(mob); - } - -.. important:: Why ``PI``? In functions requiring angles, Godot uses *radians*, - not degrees. Pi represents a half turn in radians, about - ``3.1415`` (there is also ``TAU`` which is equal to ``2 * PI``). - If you're more comfortable working with degrees, you'll need to - use the ``deg2rad()`` and ``rad2deg()`` functions to convert - between the two. - -Testing the scene -~~~~~~~~~~~~~~~~~ - -Let's test the scene to make sure everything is working. Add this ``new_game`` -call to ``_ready()``: - -.. tabs:: - .. code-tab:: gdscript GDScript - - func _ready(): - randomize() - new_game() - - .. code-tab:: csharp - - public override void _Ready() - { - NewGame(); - } - - .. code-tab:: cpp - - // This code goes in `main.cpp`. - void Main::_ready() { - new_game(); - } - -Let's also assign ``Main`` as our "Main Scene" - the one that runs automatically -when the game launches. Press the "Play" button and select ``Main.tscn`` when -prompted. - -You should be able to move the player around, see mobs spawning, and see the -player disappear when hit by a mob. - -When you're sure everything is working, remove the call to ``new_game()`` from -``_ready()``. - -What's our game lacking? Some user interface. In the next lesson, we'll add a -title screen and display the player's score. diff --git a/getting_started/first_2d_game/06.heads_up_display.rst b/getting_started/first_2d_game/06.heads_up_display.rst deleted file mode 100644 index 8e089f5..0000000 --- a/getting_started/first_2d_game/06.heads_up_display.rst +++ /dev/null @@ -1,438 +0,0 @@ -.. _doc_your_first_2d_game_heads_up_display: - -Heads up display -================ - -The final piece our game needs is a User Interface (UI) to display things like -score, a "game over" message, and a restart button. - -Create a new scene, and add a :ref:`CanvasLayer ` node named -``HUD``. "HUD" stands for "heads-up display", an informational display that -appears as an overlay on top of the game view. - -The :ref:`CanvasLayer ` node lets us draw our UI elements on -a layer above the rest of the game, so that the information it displays isn't -covered up by any game elements like the player or mobs. - -The HUD needs to display the following information: - -- Score, changed by ``ScoreTimer``. -- A message, such as "Game Over" or "Get Ready!" -- A "Start" button to begin the game. - -The basic node for UI elements is :ref:`Control `. To create our -UI, we'll use two types of :ref:`Control ` nodes: :ref:`Label -` and :ref:`Button `. - -Create the following as children of the ``HUD`` node: - -- :ref:`Label ` named ``ScoreLabel``. -- :ref:`Label ` named ``Message``. -- :ref:`Button ` named ``StartButton``. -- :ref:`Timer ` named ``MessageTimer``. - -Click on the ``ScoreLabel`` and type a number into the ``Text`` field in the -Inspector. The default font for ``Control`` nodes is small and doesn't scale -well. There is a font file included in the game assets called -"Xolonium-Regular.ttf". To use this font, do the following: - -1. Under **Theme overrides > Fonts** click on the empty box and select "New DynamicFont" - -.. image:: img/custom_font1.png - -2. Click on the "DynamicFont" you added, and under **Font > FontData**, - choose "Load" and select the "Xolonium-Regular.ttf" file. - -.. image:: img/custom_font2.png - -Set the "Size" property under ``Settings``, ``64`` works well. - -.. image:: img/custom_font3.png - -Once you've done this on the ``ScoreLabel``, you can click the down arrow next -to the Font property and choose "Copy", then "Paste" it in the same place -on the other two Control nodes. - -.. note:: **Anchors and Margins:** ``Control`` nodes have a position and size, - but they also have anchors and margins. Anchors define the origin - - the reference point for the edges of the node. Margins update - automatically when you move or resize a control node. They represent - the distance from the control node's edges to its anchor. - -Arrange the nodes as shown below. Click the "Layout" button to set a Control -node's layout: - -.. image:: img/ui_anchor.png - -You can drag the nodes to place them manually, or for more precise placement, -use the following settings: - -ScoreLabel -~~~~~~~~~~ - -- *Layout* : "Top Wide" -- *Text* : ``0`` -- *Align* : "Center" - -Message -~~~~~~~~~~~~ - -- *Layout* : "HCenter Wide" -- *Text* : ``Dodge the Creeps!`` -- *Align* : "Center" -- *Autowrap* : "On" - -StartButton -~~~~~~~~~~~ - -- *Text* : ``Start`` -- *Layout* : "Center Bottom" -- *Margin* : - - - Top: ``-200`` - - Bottom: ``-100`` - -On the ``MessageTimer``, set the ``Wait Time`` to ``2`` and set the ``One Shot`` -property to "On". - -Now add this script to ``HUD``: - -.. tabs:: - .. code-tab:: gdscript GDScript - - extends CanvasLayer - - signal start_game - - .. code-tab:: csharp - - public class HUD : CanvasLayer - { - // Don't forget to rebuild the project so the editor knows about the new signal. - - [Signal] - public delegate void StartGame(); - } - - .. code-tab:: cpp - - // Copy `player.gdns` to `hud.gdns` and replace `Player` with `HUD`. - // Attach the `hud.gdns` file to the HUD node. - - // Create two files `hud.cpp` and `hud.hpp` next to `entry.cpp` in `src`. - // This code goes in `hud.hpp`. We also define the methods we'll be using here. - #ifndef HUD_H - #define HUD_H - - #include - #include - #include - #include - #include - - class HUD : public godot::CanvasLayer { - GODOT_CLASS(HUD, godot::CanvasLayer) - - godot::Label *_score_label; - godot::Label *_message_label; - godot::Timer *_start_message_timer; - godot::Timer *_get_ready_message_timer; - godot::Button *_start_button; - godot::Timer *_start_button_timer; - - public: - void _init() {} - void _ready(); - void show_get_ready(); - void show_game_over(); - void update_score(const int score); - void _on_StartButton_pressed(); - void _on_StartMessageTimer_timeout(); - void _on_GetReadyMessageTimer_timeout(); - - static void _register_methods(); - }; - - #endif // HUD_H - -The ``start_game`` signal tells the ``Main`` node that the button -has been pressed. - -.. tabs:: - .. code-tab:: gdscript GDScript - - func show_message(text): - $Message.text = text - $Message.show() - $MessageTimer.start() - - .. code-tab:: csharp - - public void ShowMessage(string text) - { - var message = GetNode