Amr Wael2 نشر 8 نوفمبر 2020 أرسل تقرير مشاركة نشر 8 نوفمبر 2020 كيف يمكنني ان ابرمج عدو 2d في لعبة platform في بيئة العملGodot Game engine اتمنى الرد اقتباس رابط هذا التعليق شارك على الشبكات الإجتماعية More sharing options...
0 كريم أمعطيل نشر 9 نوفمبر 2020 أرسل تقرير مشاركة نشر 9 نوفمبر 2020 مرحباً, للأسف السؤال يشمل عدد ضخم من المعلومات وصعب الإجابة عنه إجابة محددة لكن سأُدرج كود مثال لعدو طائر لتتمكن من أخد فكرة حول البرمجية وتطبيقها في فكترتك الخاصة # MAX_SPEED تضم بعض الثوابت من قبيل extends "res://Enemies/Enemy.gd" export(int) var ACCELERATION = 100 # WorldCameraحفظ اللاعب و الـ var MainInstances = ResourceLoader.MainInstances onready var sprite = $Sprite func _ready(): # تجميد الحركة, تفعيلها يتم عبر VisibilityNotifier2D حيث يتحرك العدو ويلاحق الشخصية الرئيسية عندما تقترب منه set_physics_process(false) func _physics_process(delta): var player = MainInstances.Player if player != null: chase_player(player, delta) func chase_player(player, delta): # تحصل على الإتجاهات بإعتماد PlayerPosition - EnemyPosition. var direction = (player.global_position - global_position).normalized() enter code here motion += direction * ACCELERATION * delta motion = motion.clamped(MAX_SPEED) # توجيه العدو لينظر جهة اللاعب sprite.flip_h = global_position < player.global_position motion = move_and_slide(motion) func _on_VisibilityNotifier2D_screen_entered(): set_physics_process(true) لكن أنصحك بشدة بالإطلاع على التعليمات الرسمية لـGodot : https://docs.godotengine.org/en/latest/getting_started/step_by_step/your_first_game.html وهذه بعض المواضيح الأخرى التي ستساعدك : https://docs.godotengine.org/en/latest/tutorials/2d/2d_movement.html https://docs.godotengine.org/en/latest/tutorials/physics/using_kinematic_body_2d.html https://docs.godotengine.org/en/latest/tutorials/2d/2d_sprite_animation.html https://docs.godotengine.org/en/latest/tutorials/physics/ray-casting.html بالتوفيق اقتباس رابط هذا التعليق شارك على الشبكات الإجتماعية More sharing options...
0 Megan Ortega نشر 30 أبريل 2022 أرسل تقرير مشاركة نشر 30 أبريل 2022 لقد استمتعت أيضًا بلعب لعبة Godot ولعبة Minecraft أيضًا. ألعاب رائعة! اقتباس رابط هذا التعليق شارك على الشبكات الإجتماعية More sharing options...
0 Megan Ortega نشر 1 مايو 2022 أرسل تقرير مشاركة نشر 1 مايو 2022 بتاريخ On 30/4/2022 at 14:35 قال Megan Ortega: لقد استمتعت أيضًا بلعب لعبة Godot ولعبة minecraft أيضًا. ألعاب رائعة! اقتباس رابط هذا التعليق شارك على الشبكات الإجتماعية More sharing options...
السؤال
Amr Wael2
كيف يمكنني ان ابرمج عدو 2d في لعبة platform في بيئة العملGodot Game engine
اتمنى الرد
رابط هذا التعليق
شارك على الشبكات الإجتماعية
3 أجوبة على هذا السؤال
Recommended Posts
انضم إلى النقاش
يمكنك أن تنشر الآن وتسجل لاحقًا. إذا كان لديك حساب، فسجل الدخول الآن لتنشر باسم حسابك.