چگونه بازی پلت فرم بسازیم

3
  • 1 favourites

Index

Tagged

Stats

21,462 visits, 30,301 views

Tools

License

This tutorial is licensed under CC BY 4.0. Please refer to the license text if you wish to reuse, share or remix the content contained within this tutorial.

Jump-thru objects

اشیاء جامپ-ثرو

If you place some tiles around, you might notice if you jump in to a tile from underneath you hit your head on it and fall back down. What if you want to make platforms you can jump on to from underneath? This is what the Jump-thru behavior does. Like the Solid behavior you can stand on it with the Platform behavior, but the player can jump on to it from underneath. اگر در اطراف تعدادی تایل قرار دهید، ممکن است متوجّه شوید که اگر بخواهید از زیر یک تایل به رویش بپرید سرتان به آن برخورد می‌کند و پایین می‌افتید. اگر بخواهید پلت فرم‌هایی بسازید که بتوانید از زیرشان به رویشان بپرید چه؟ این کاری است که رفتار Jump-thru انجام می‌دهد. مثل رفتار Solid شیء دارای رفتار Platform می‌تواند روی آن بایستد، با این تفاوت که این بار پلیر می‌تواند از زیر آن هم به رویش بپرد.

Let's make a Jump-thru version of our Tile object. Right-click the Tile object and select Clone object type. This will make a separate object type, Tile2, which can have different behaviors. Delete the Solid behavior and add the Jump-thru behavior. بیایید نسخه‌ای از شیء تایل دارای رفتار Jump-thru بسازیم. روی شیء Tile کلیک راست کنید و Clone object type را انتخاب کنید. با این کار یک آبجکت تایپ جدا می‌سازید، Tile2، که می‌توانند رفتار‌های متفاوتی داشته باشد. رفتار Solid را حذف کنید و رفتار Jump-thru را اضافه کنید.

Use tiles 134 and 135 to make a jump-thru like this: از تایل شماره‌ی 134 و 135 استفاده کنید تا یک جامپ-ثرو مثل زیر بسازید.

Run the game. Notice how you can jump on to it from underneath. بازی را اجرا کنید. توجّه کنید که چگونه می‌توانید از زیر روی آن بپرید.

Hopefully you now know enough to design a whole level! Here's a zoomed out level design I put together quickly while writing the tutorial. It might help show you some of the possibilities. Notice the use of markers across platforms to keep the snails on their platforms. امیدوارم تا به حال به اندازه‌ی کافی بدانید که چگونه بتوانید مرحله‌ای کامل طرّاحی کنید! اینجا مرحله‌ای را می‌بینید که به عقب زوم شده است و من آن را به سرعت در حین نوشتن آموزش طرّاحی کردم. ممکن است به نشان دادن بعضی از امکانات کمک کند. توجّه کنید که در طول پلت فرم‌ها از نشان‌گذارها استفاده کنید تا حلزون‌ها از رویشان نیفتند.

Parallax

پارالاکس

Try adding a parallax effect to make the background seem further away. Select the Background layer in the layers bar. In the properties bar, set the Parallax property to 50, 50 (which means half speed scrolling). Notice how the background moves slower, giving a distance feel. Using multiple layers all with different parallax rates can create an almost 3D feel to a 2D game. سعی کنید یک افکت پارالاکس اضافه کنیم تا پس‌زمینه دورتر به نظر برسد. در نوار لایه‌ها لایه‌ی Background را انتخاب کنید. در نوار ویژگی‌ها، ویژگی Parallax را به 50،50 تنظیم کنید (که یعنی نصف سرعت پیمایش). توجّه کنید که چگونه پس‌زمینه آهسته‌تر حرکت می‌کند، احساس دور بودن به انسان می‌دهد. استفاده از چندین لایه که همگی دارای پارالاکس‌هایی با میزان متفاوت هستند تقریباً به بازی دو بعدی احساس سه بعدی بودن می‌دهد.

Conclusion

جمع بندی و پایان

This tutorial covered a lot. You may want to revise it some time. Here are some of the key points: این آموزش بخش‌های زیادی را پوشش داد. ممکن است گاهی اوقات بخواهید دوباره این را بخوانید. اینجا تعدادی از نکات کلیدی هستند:

- For the player's Platform behavior, always add the movement to an invisible box with no animations. Position the visible, animated player sprite on top of the box. This will prevent animations causing glitches in the platform movement. - برای رفتار Platform پلیر، همیشه حرکت را به مستطیلی نامرئی که انیمیشنی ندارد بدهید. اسپرایت پلیر که دارای انیمیشن است و دیده می‌شود را روی آن مستطیل قرار دهید. این کار از اشکالاتی که انیمیشن‌ها برای حرکت پلت فرم ایجاد می‌کنند جلوگیری می‌کند.

- Levels can be built out of tiles. - مرحله‌ها می‌توانند از تایل‌ها ساخته شوند.

- The Set mirrored action saves you having to make mirrored copies of all your animations. - اکشن Set mirrored شما را از ساختن کپی‌هایی از تمام انیمیشن‌ها که قرینه‌ی هم هستند بی نیاز می‌کند.

- Animations sometimes need some work to get imported, set up with the right speed and looping properties, with the right origin set, and all frames cropped. You may also want to alter the collision masks, although this was not covered. - گاهی اوقات برای اینکه انیمیشن‌ها را وارد کنیم چند کار باید انجام دهیم، سرعت درست و تکرار را تنظیم کنیم، محلّ صحیح نقطه‌ی مبدأ را تعیین کنیم، و قسمت‌های اضافی همه‌ی فریم‌ها را برش دهیم. حتّی شاید بخواهید کالیژن ماسک‌ها را تغییر دهید، اگرچه این جزء آموزش ما نبود.

- Enemies can also be controlled with the Platform behavior. Set Default Controls to No and use the Simulate control action to automatically control movement. - دشمن‌ها نیز با رفتار پلت فرم قابل کنترل هستند. Default Controls را به No تنظیم کنید و برای کنترل خودکار حرکت از اکشن Simulate control استفاده کنید.

- You can detect if the player is falling on an enemy rather than running in to them by testing if they are both falling and above the enemy on the Y axis when colliding. Otherwise (using 'Else'), they must be running in to the enemy, and they should get hurt. - شما می‌توانید تشخیص دهید که آیا پلیر از بالا روی دشمن پریده‌است و یا در حال راه رفتن به آن برخورد نموده است. با بررسی این‌که آیا پلیر هنگام برخورد هم در حال سقوط بوده و هم در محور Yها بالای دشمن قرار داشته است. در غیر این صورت (با استفاده از Else)، در حال راه رفتن به دشمن برخورد کرده است، و باید آسیب ببیند.

- Instance variables can store numbers or text unique to each instance of an object. This helps control objects individually, which is useful for "AI". - متغیّرهای اینستنس می‌توانند اعداد یا متن‌هایی را برای هر اینستنس شیء به صورت جداگانه در خود ذخیره کنند. این به کنترل اشیاء به صورت جداگانه کمک می‌کند، که برای هوش مصنوعی خیلی مفید است.

- Edge markers are a quick and easy way to make enemies go back and forth on a platform. - نشان‌گذارهای لبه‌ها راهی سریع و آسان برای این هستند که دشمن‌ها روی پلت فرم به عقب و جلو حرکت کنند.

- Jump-thru are platforms that can be jumped on to from underneath. - جامپ-ثروها (Jump-thru) پلت فرم‌هایی هستند که می‌توانید از زیرشان به رویشان بپرید.

- Parallax is an easy and intriguing effect to add to platform games. - پارالاکس افکتی جذّاب و ساده است که به بازی‌های پلت فرم اضافه می‌شود.

Obviously we have not made a full platform game! However, this tutorial has covered the most difficult bits, and the important essentials every platform game creator should know in advance. From here on hopefully you have an idea of how the rest of a platform game is going to come together. It takes time to get familiar with a complex development tool with Construct 2. However, experimenting can be fun, and teach you a lot! So spend a while playing around, breaking things, tweaking things, and see what you can come up with. Happy platforming! واضح است که ما یک بازی پلت فرم کامل نساخته ایم. امّا، این آموزش اغلب مشکلات، و واجبات مهمّی را که هر سازنده‌ی بازی‌های پلت فرم در سطح حرفه‌ای باید بداند پوشش داده است. در اینجا امیدوارم که شما ایده‌ای داشته باشید که چگونه بازی پلت فرم بسازید. وقت زیادی می‌برد که با ابزار پیچیده‌ی توسعه در سی2 آشنا شوید. امّا، آزمون و خطا می‌تواند یک سرگرمی باشد، و چیزهای زیادی به شما بیاموزد! بنابراین لحظه‌ای در اطراف بازی کنید، چیزها را تفکیک کنید، بپیچانید، و ببینید با آن‌ها چه می‌توانید بکنید. بازی پلت فرم مبارک!

Further reading

You may be interested in the alternative beginner's guide, which is a tutorial to make a top-down shooter. It covers some different points like making a heads-up display, and goes in to instance variables in some more detail too. These are both things that can be applied to platform games, so it would definitely be useful to go through it in addition to this tutorial.

Want to add music and sound effects? See Sounds & Music in the manual.

If you'd like to know more about how events work in Construct 2, see the section on How Events Work in the manual. It's highly recommended so you can get going quickly with your own projects! Then for even more information, don't forget there is complete documentation in the manual.

  • 0 Comments

  • Order by
Want to leave a comment? Login or Register an account!