设为首页收藏本站同能贴吧 切换语言 繁体中文
开启辅助访问 切换到窄版
扫描二维码关注官方公众号
返回列表
+ 发新帖
查看: 77|回复: 0

[制作教程] Punch the Birds Mini-game (Or other catch the falling item games)

[复制链接]
累计送礼:
0 个
累计收礼:
1 个
  • TA的每日心情
    慵懒
    3 天前
  • 签到天数: 207 天

    连续签到: 1 天

    [LV.7]常住居民III

    3646

    主题

    862

    回帖

    2万

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    VIP
    7
    卡币
    21262
    OK点
    16
    推广点
    0
    同能卷
    50
    积分
    25800

    灌水之王

    发表于 昨天 20:30 | 显示全部楼层 |阅读模式
    Hi all, first time posting in the tutorials section. I've made this mini-game for my own project, and have no idea if anyone has posted something similar before, so I'll just go ahead and share.

    Spoiler: Video
    Introduction:
    This mini-game has many variants, like catching fruit with a basket or collecting coins. For the purposes of this tutorial I will be using the backstory of Harold and friends getting flying powers from a fairy to punch some chickens.

    Plugins Used:
    The plugins we need is Yanfly's Core Engine, Region Restrictions and Move Route Core. These are all included in the Free Starter Pack Essentials bundle.

    Variables and Switches
    2 Variables are used for the Score and Highscore respectively, although it is technically optional. A third variable will be needed for a timer on the mini-game (Unless Harold wants to change his career to chicken puncher)

    Spoiler: Step 1: Creating the scene
    Depending on your screen size, the best map size may change, but I would recommend making it such that the map will not scroll vertically when moving the player. Also, make the ends of the map not visible to the player.
    I'm using a 19 x 13 map with a 816 x624 game window.

    Add a nice parallax and let it scroll for the illusion of movement.
    As for the Tileset... we don't need one! By use of region restrictions, we can control the movable area of the player.

    Spoiler: Step 2: Set the map
    Go to the Region Restrictions plugin and set a region for 'Event Allow' and 'All Allow'. The rest are unneeded for this barebones build of the mini-game. Cover the entire area with the 'Event Allow' region. Draw out the area you want to allow your player to move around in with the 'All Allow' region. I'm just using a line in this case






    We'll come back to this map later, but for now let's make the second map, where we set the event to launch this game.
    Spoiler: Step 3: The launcher NPC
    Create another map, use one of your existing ones, it's all fine. The important thing is to have an NPC to run the game.
    The only thing this NPC needs to do is to transfer the player into the mini-game map, but you can also turn off the followers and fixed the direction of the player to make the game neater. If you're using a score system, remember to set the current score to 0.

    Note: Ignore the self switch that I have on this NPC, its irrelevant.

    Spoiler: Step 4: The Birds
    Back at the mini-game map with the region restrictions, create a new event on the right end of the map. This will be the object you want your player to catch.  Set it to run in parallel and run the following events:

    Set a variable (mentioned previously) to the number of frames for this event to wait until it 'spawns' in the mini-game. I find a random 60-600 frames (1-10 seconds) quite decent.

    Next, run a script for a wait time same as the respawn variable with the script call "this.wait($gameVariables.value(x))", replacing x with the respawn variable.

    Set the self-switch to trigger once the wait is complete, and the we move on to page 2!
    Note: For page 1, the image can be left blank.






    Step 4.5
    In page 2 of the object event,
    Put the graphic (I highly recommend chicken) and tick the Walking, Stepping and Direction Fix boxes. Set the priority to Same as Characters, else the chicken will run right under Harold's legs! Use Event Touch as the trigger. Now the event contents will play when the chicken touches Harold.

    Put an animation to show that you've successfully punched/caught the object, and use a move event with the 'Teleport: x, y' scriptcall to bring the object back to its original position. The original position of the object can be seen at the bottom left of the editor, so you don't have to keep closing and opening it.

    Turn off the self-switch to bring the object back to its waiting phase. If you are counting score, remember to add or subtract from the variable!



    Step 4.75
    In a custom move route on page 2, use the Move Route Core plugin to call for a script to move the chicken to the left end of the map. Remember to use 'Crash Move To' rather than the regular 'Move To', or the object will dodge the player.
    Once it reaches the end, teleport it back to its original position.
    Since there is no toggle self-switch button in move routes, we have to use a script instead. Use this format

    $gameSelfSwitches.setValue([a, b, 'c'], false)

    a is the map id, b is the event id and c is the self switch (I'm using 'A' as c, don't get confused). Remember to put a quote around the self switch letter. Refer to the picture below for an example.



    Step 4.875
    Aaaand we're finally done with the object! The last thing for this part is to copy-paste the object a few times to make more objects. Remember to change the event id of the object in the self switch part! Also adjust the co-ordinates for the 'Crash Move To' and the 'Teleport' script calls! If the objects behave weirdly when testing, this is the most likely reason.

    Now Harold can catch chickens forever! But what if he needs to go back to saving the world?
    Spoiler: Step 5: Timer
    Create a new event. This will be the timer for the game. Set the first page to Trigger in parallel. Set a wait command for however long you want the round to last. 60 frames = 10 seconds, so my example is 25s with 1500 frames.

    After the timer is done, it needs to record the highscore, if you want that function. Do a check to see if the current score is higher than the highscore, and replace it if it is. Now flip a self switch to toggle the 2nd page, and set it to Autorun. This page is in is just to do all the clean up before transferring the player back to the original map. Turn off Direction Fix, turn on Followers etc.

    The reason we need a second page is that anything after a map transfer event stops working after the transfer, due to page 1 being in parallel. Basically, the fade in won't work and Harold will be trapped in darkness forever.

    And we're done!
    This basic game can be modified in many ways. Change the movement of the objects, give the player more than a line to move in, make the goal to avoid the objects instead, there is a lot of possibility.

    I hope this will help anyone thinking of adding a simple mini-game for their heroes taking a break from fighting evil. As always, I recommend punching chickens.


    本贴来自国际rpgmaker官方论坛作者:JMsoup处,因国际论坛即将永久关站,为了存档多年珍贵资料,署名转载到本论坛存档,由于官方帖子为英文原帖,需要中文翻译请点击论坛顶部切换语言为中文就可以将帖子翻译成中文浏览,方便大家随时查看,原文地址:https://forums.rpgmakerweb.com/threads/punch-the-birds-mini-game-or-other-catch-the-falling-item-games.126938/

    本帖子中包含更多资源

    您需要 登录 才可以下载或查看,没有账号?立即注册

    x
    天天去同能,天天有童年!
    回复 送礼论坛版权

    使用道具 举报

    文明发言,和谐互动
    文明发言,和谐互动
    高级模式
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    简体中文
    繁體中文
    English(英语)
    日本語(日语)
    Deutsch(德语)
    Русский язык(俄语)
    بالعربية(阿拉伯语)
    Türkçe(土耳其语)
    Português(葡萄牙语)
    ภาษาไทย(泰国语)
    한어(朝鲜语/韩语)
    Français(法语)
    关闭

    幸运抽奖

    社区每日抽奖来袭,快来试试你是欧皇还是非酋~

    立即查看

    聊天机器人
    Loading...

    QQ|Archiver|手机版|小黑屋|同能RPG制作大师 ( 沪ICP备12027754号-3 )

    GMT+8, 2026-7-10 01:13 , Processed in 0.083509 second(s), 53 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表