
ããªããã²ãŒã ã奜ããªããããªãã¯ããããã©ã®ããã«äœãããã®ãçåã«æã£ãŠããããšã¯ééããããŸããã ã²ãŒã ãäœãããããçµéšããªãå Žåã¯ããã®èšäºã§å§ããæ¹æ³ã«ã€ããŠã話ããŸãã
ã²ãŒã ãšã³ãžã³Game Makerã«ã€ããŠè©±ããPlants vs Zombiesãªã©ã®åçŽãªã²ãŒã ã®ã¯ããŒã³ãäœæããåºçç©ãæçš¿ããããšæããŸãã ãããããã²ãŒã ãããã®ãµããŒããè¿œå ããããšãã°AndroidããŒãžã§ã³ãäœæããŸãã
ãœãŒã¹ã³ãŒãã¯å ¬éãããŸãããç¡æã§æç»ããŠã³ãã¥ããã£ãšå ±æããã人ãããªãå Žåãã°ã©ãã£ãã¯ã¯GraphicRiverã§è³Œå ¥ãããæçœãªçç±ã§ã²ãŒã ãšãšãã«é åžãããŸããã ãŸããã²ãŒã ã«ã¯è±å¯ãªã¢ãã¡ãŒã·ã§ã³ããããŸããã
ãšã³ããªãŒ
Game Makerã¯éåžžã«ã·ã³ãã«ãªã²ãŒã ãšã³ãžã³ã§ãããWindowsãMac OS XãUbuntuãAndroidãiOSãTizenãWindows PhoneãWindows 8ãPlayStation 3ãPS 4ãPS VitaãXbox OneãHTMLã®å€æ°ã®ãã©ãããã©ãŒã åãã®ã²ãŒã ãäœæã§ããŸã5. SteamWorksã®ãµããŒãããããŸãã ã²ãŒã ãæåããå Žåãå¥ã®ãã©ãããã©ãŒã ãžã®ç§»æ€ã¯é£ãããããŸããã
æ§ãããªç¥èãšåæ©ãæå°éã§ãã£ãŠããéçºé床ã¯ä»ã®ãšã³ãžã³ããã䞻芳çã«é«éã§ãã åå¿è åãã®ã€ã³ã¹ããŒã«ãšã»ããã¢ããã¯å¯èœãªéãç°¡åã§ãç¹å¥ãªç¥èã¯å¿ èŠãããŸããã ä»ã®ãã©ãããã©ãŒã çšã®ã³ã³ãã€ã«ã§ã¯ãã²ãŒã ã³ãŒããå€æŽããå¿ èŠã¯ãªããã¯ã³ã¯ãªãã¯ã§ïŒãŸããã»ãŒïŒå®è¡ãããŸãã
Game MakerãäœæããäŒç€Ÿã§ããYoYoGamesã¯ãæè¿Playtechã«è²·åãããŸãããããã«ãããGame Makerã¯ä»åŸãæé·ãç¶ãããšç¢ºä¿¡ã§ããŸãã çºè¡šãããGame Maker 2.0ã¯ãããããããã«ãã¬ã³ããªãŒã§ã·ã³ãã«ãªãã®ã«ãªãã§ãããããŸããããã«åªããæ©èœãåããŠãããšèããã®ãçã«ããªã£ãŠããŸãã 圌ãããã¬ã¹ãªãªãŒã¹ã§èšãããã«ãGM 2.0ã¯äŒç€Ÿãè²·åããçç±ã®1ã€ã§ãã
ãã®èšäºã§ã¯ãGame Makerã«ã€ããŠç°¡åã«èª¬æããå°æ¥ã®ãããžã§ã¯ãã®ç°¡åãªã¹ã±ãããäœæããŸãã
ãã®ãšã³ãžã³ã¯èª°ã®ããã«ãã©ã®ãããªç®çã§äœ¿çšã§ããŸããïŒ
çã®ããã«ã ç®æšã¯2Dã²ãŒã ã§ãã ãã ããããã°ã©ãã³ã°ããã€ãã£ããªèŠçŽ ã§ã¯ãªã人ããã²ãŒã ãäœæããããéã皌ããã人ã®ããã«æå°éã®åŽåã§ã©ããããããã¿ã€ãã³ã°ãšã²ãŒã ãäœæããå Žåã¯ãGame Makerãæé©ã§ãã
ã²ãŒã ã¡ãŒã«ãŒã®é·æ
-ç°¡åãªå ¥å;
-Java / C / CïŒ...æ§æã®èª°ããç¥ã£ãŠããã
-ç°ãªããã©ãããã©ãŒã ã§ç°¡åã«ã³ã³ãã€ã«ããæ©èœã
-é·å¹Žã«ããã£ãŠæ¢ã«å€ãã®åé¡ã解決ããã³ãŒããæžããŠãã掻çºãªã³ãã¥ããã£ã
-æšæºæ©èœãããã«ããã倧éã®ã³ãŒããèªåã§èšè¿°ããå¿ èŠããªããªããŸãã
-extension'yã«ããæ¡åŒµæ§ã
-ãã«ãïŒF1ïŒã¯éåžžã«ã·ã³ãã«ã§äŸ¿å©ã§ãåªãã説æãšäŸããããŸãã
ã²ãŒã ã¡ãŒã«ãŒã®çæ
-ææïŒã²ãŒã ã®åºçãŸã§æé·ããããã©ã€ã»ã³ã¹ãè³Œå ¥ããå¿ èŠããããŸãïŒ;
-ãŠãŒã¶ãŒå€æ°ã®èªå眮æã¯ãªããæšæºããã³ã¹ã¯ãªããã®ã¿ã
-æ倧ã©ã€ã»ã³ã¹ã®é«ã³ã¹ãïŒãã ãã誰ãããã¹ãŠã®ã¢ãžã¥ãŒã«ãçŽæ¥å¿ èŠãšããããã§ã¯ãããŸããïŒã
-æè¡ãµããŒãïŒæè¡ãµããŒãã«2åé£çµ¡ããŸãããã2é±éåŸãããæ©ãå¿çããŸããã§ããïŒã
-èªå修埩ã®å¯èœæ§ã¯ãããŸããã
ã²ãŒã ã®äœæã«ç§»ããŸãã ã²ãŒã ã¡ãŒã«ãŒãã€ã³ã¹ããŒã«ããŠç©ºã®ãããžã§ã¯ããäœæããããšã¯åé¡ã§ã¯ãªããšæããŸãã äžè¬ã«ããŸãããã¹ãŠã®æ©èœã«ã€ããŠèãããã€ã¢ã°ã©ã ãæç»ããåçåã«ã€ããŠèããŠã¿ããšããã§ãããããããã¯èšäºã®ç®çã§ã¯ãªãã®ã§ãåå¿è ã®ã²ãŒã éçºè åãã®ãããžã§ã¯ããäœæããæ¹æ³ã玹ä»ããŸãã
ãããžã§ã¯ãæ§é ã«ã€ããŠç°¡åã«èª¬æããŸãã
- ã¹ãã©ã€ã-ã¹ãã©ã€ãïŒç»åãã¢ãã¡ãŒã·ã§ã³ïŒãå«ããã©ã«ããŒã
- ãªããžã§ã¯ã-æºåãããã€ãã³ãïŒããšãã°ãäœæãã¬ã³ããªã³ã°ãã¯ãªãã¯ãªã©ïŒãæã€ãªããžã§ã¯ãã
- éšå±-ã²ãŒã 宀ïŒã¹ã¯ãªãŒã³ïŒã ç»é¢ããšã«ãèªåã®éšå±ãäœãå¿ èŠããããŸãã éåžžã«å¿«é©ã§ãã
- èæ¯-éšå±ãåããããšãã§ããèæ¯ã ã¿ã€ã«ã»ãããšããŠã䜿çšãããŸãã
æ®ãã¯ãŸã èå³ããããŸããã
Game Makerã®ã¹ãã©ã€ããšã¯äœã§ããïŒ
ããã¯ãã²ãŒã ã§äœ¿çšãããç»å/ã¢ãã¡ãŒã·ã§ã³ã§ãã ãããã«ã¯ç¬èªã®ãã¹ã¯ãããããã®åœ¢ç¶ãšãµã€ãºã¯å€æŽã§ããŸãã ãã¹ã¯ã¯ããªããžã§ã¯ãã®è¡çªã®ã€ãã³ãã«åå¿ããç»åé åã§ãïŒãã®ã¹ãã©ã€ããäœããã®ãªããžã§ã¯ãã«å²ãåœãŠãããŠããå ŽåïŒãã¯ãªãã¯ããŸãã æç»ç¹ïŒåç¹ïŒãæå®ã§ããŸã-ããšãã°ãäžå¿ãè§ããŸãã¯ãã®ä»ã®ç¹ããã
ã¹ãã©ã€ãã®ãã¯ã¹ãã£ã°ã«ãŒããæå®ããããšãã§ããŸãã ã¬ã³ããªã³ã°ãæé©åããå¿ èŠããããŸãïŒããšãã°ãã²ãŒã ç»é¢ããããšãã«ã¡ãã¥ãŒç»é¢ã§äœ¿çšãããç»åãå«ããã¯ã¹ãã£ããŒãžãä¿åããå¿ èŠã¯ãããŸããïŒã ãã¯ã¹ãã£ã°ã«ãŒãããšã«ãããããåäœãããã©ãããã©ãŒã ãæå®ã§ããŸãã ããšãã°ãAndroidã®å ŽåãWindows 8ã¿ãã¬ããã®å Žåããã詳现床ã®äœãç»åã䜿çšã§ããŸãã
ã²ãŒã ã¡ãŒã«ãŒã®ãªããžã§ã¯ããšã¯äœã§ããïŒ
ããã¯ãç¬èªã®ã¡ãœããïŒé¢æ°ïŒãæã€ãšã³ãã£ãã£ã®èª¬æã§ãã åãªããžã§ã¯ãã¯ïŒç¹ã«æå®ãããŠããªãéãïŒèªèº«ãæç»ããæšæºã®ã€ãã³ãïŒããŒã¹ãããŒã¯ãã¹ãã©ã€ãã®ã¯ãªãã¯ãªã©ïŒã«åå¿ããŸããOOPãšåæ§ã«ãããã¯ã¯ã©ã¹ã§ãã
Game Makerã®ã€ã³ã¹ã¿ã³ã¹ãšã¯äœã§ããïŒ
ãªããžã§ã¯ãããšã³ãã£ãã£ã®åãªã説æã§ããå Žåãã€ã³ã¹ã¿ã³ã¹ã¯ãªããžã§ã¯ãã®ã€ã³ã¹ã¿ã³ã¹ã§ãããã²ãŒã èªäœã§ã®å®è£ ã§ãã ã€ã³ã¹ã¿ã³ã¹ãäœæããããšã§ãã€ã³ã¹ã¿ã³ã¹ã«åœãå¹ã蟌ããšããªããžã§ã¯ãå ã«èª¬æããããã¹ãŠã®ã€ãã³ããåå¿ãå§ããŸãã
OOPãšåæ§ã«ãããã¯ãªããžã§ã¯ãã§ãã
æåã«è¡ãããšã¯ãæ°ããéšå±ãäœæããããšã§ãïŒå·Šãã€ã³ã§ã[éšå±]-[éšå±ã®äœæ]ãå³ã¯ãªãã¯ããŸãïŒã rm_gameãšåŒã³ãŸãããã [èšå®]ã¿ãã§ãŠã£ã³ããŠãµã€ãºãèšå®ããŸã-å¹ -800ãé«ã-480ãé床-60ãã€ãŸãã ã²ãŒã ã¯800x480ã®ãŠã£ã³ããŠã§è¡ãããfpsã¯60ãã¬ãŒã ãè¶ ããªãåŸåããããŸãã ä¿åããŠéããŸãã
ã¹ãã©ã€ããããã€ãè¿œå ããŸãã Sprites-> Spriteãã©ã«ãã®äœæãå³ã¯ãªãã¯ããŸãã ãããspr_unit_shooterãšåŒã³ã54x54ãµã€ãºãªã©ã®ç»åïŒèšäºã®æåŸã«ããgithubã§å ¥æå¯èœïŒãã¢ããããŒãããŠäžå€®ã«é 眮ããŸãïŒäžå€®ãã¿ã³ïŒã [OK]ãã¿ã³ãšããŒã¿ãä¿åãããŸãã

次ã«ãæåã®ãŠããããå¿ èŠã§ãã å€å žçãªå°æå Žã«ããŸãããã ãããããã®åã«ããã¹ãŠã®ãŠãŒã¶ãŒãŠãããã®èŠªãšãªããªããžã§ã¯ããäœæããããšããå§ãããŸãïŒã¯ããOOPã®ç¶æ¿ãšã»ãŒåãã§ãïŒã ããã«ããããã¹ãŠã®ãŠãããã«å¯ŸããŠããžãã¯ãç¹°ãè¿ãããšãåé¿ã§ããŸãã以äžã«ç€ºãããã«ãã²ãŒã äžã«ãã®ãªããžã§ã¯ãã«ãã£ãŠäœæããããã¹ãŠã®ã¿ã€ãã®ããªããžã§ã¯ãããåç §ã§ããŸãã
ã¹ãã©ã€ããšéšå±ã«äŒŒãåçã«ããã空ã®ãªããžã§ã¯ããäœæããŸãã ããão_unit_parentãšåŒã³ãŸãããä»ã«ã¯äœãããŸããã o_unit_shooterãäœæããParentåã§o_unit_parentãéžæããŸãã 圌ã«ã¹ãã©ã€ã-spr_unit_shooterãäžããŸãããã ãããè¡ãã«ã¯ãååã®äžã«ãããã¿ã³ã䜿çšããŸãã

ã¹ãã©ã€ãããªããžã§ã¯ããéšå±ãªã©ã«ååãä»ãã 䟿å©ã§ãããåŸã§æ··ä¹±ããªãããã«ãããã«ã¹ããŒããã¹ããŒããšåŒã³ãŸããããšãã°ãæ¥é èŸspr_ãæã€ã¹ãã©ã€ãããªããžã§ã¯ãobj_ãŸãã¯o_ãã¹ã¯ãªãã-scr_ãªã©ã§ãã
ããã§ãã«ãŒã ã§o_unit_shooterãªããžã§ã¯ããäœæãããã³ã«ãéžæããã¹ãã©ã€ããæç»ãããŸãïŒãã¡ããããããã³ãŒãã§ãªãŒããŒã©ã€ãããªãå ŽåïŒã
ã¹ãã©ã€ãã¯ããã°ã©ã ã§èšå®ããããšãã§ããŸããããã®å Žåãå·ŠåŽã®ãããžã§ã¯ãæ§é ãã¬ãã¥ãŒã«ã¯è¡šç€ºãããŸããã 次ã«ããªããžã§ã¯ãã®ã€ã³ã¹ã¿ã³ã¹ãäœæããããšãã«çºçããã€ãã³ããè¿œå ããŸãã ãã®ã€ãã³ãã§ã¯ãå€æ°ã®åæåæåãèšå®ããå¿ èŠããããŸãïŒååšããå ŽåïŒã [ã€ãã³ããè¿œå ]ãã¯ãªãã¯ããŸãã ã芧ã®ãšãããã²ãŒã ã¡ãŒã«ãŒã§ã¯ãåãªããžã§ã¯ããå€æ°ã®ã€ãã³ãããã£ããã§ããŸãã èå³ããã-äœæããŸãã
ã¢ã¯ã·ã§ã³ã³ã³ãããŒã®å³åŽã«ããããã«ãããã€ãã®ã¿ãã«ã¯èšå€§ãªéã®ãã©ãã°ã¢ã³ãããããèŠçŽ ããããçè«çã«ã¯ã1è¡ã®ã³ãŒããèšè¿°ããããšãªãå®å šãªã²ãŒã ãäœæã§ããŸãã ããããããã¯å€æ åãã§ãããããããGame Maker 2.0ã§ã¯ããã®äžèŠãªæ©èœã¯æçµçã«åé€ãããŸãã
[ã³ãŒãã®å®è¡]ã¢ã€ã³ã³ããã©ãã°ãŸãã¯å³ã¯ãªãã¯ããŠã[ã³ã³ãããŒã«]ã¿ããã¯ãªãã¯ããŸãã ã²ãŒã ããžãã¯ãé 眮ã§ããããã¹ããšãã£ã¿ãŒãéããŸãã
èŠããŠããããã«ããŠãããã¯äžå®ã®æéã§æããªããã°ãªããŸããã ããã¯éåžžã«ç°¡åã«è¡ããŸãã Createã€ãã³ãã§ã次ã®ã³ãŒããèšè¿°ããŸããalarm [0] = room_speed * 2;
ããã¯ãçªå·0ã§ã¢ã©ãŒã ãå®è¡ããroom_speed * 2ã¹ãããïŒãã¬ãŒã ïŒã§èµ·åããããšãæå³ããŸãã room_speedã¯60ã«çãããããã¯1ç§ã«ã»ãŒçããã§ãã ãããã£ãŠãã¢ã©ãŒã [0]ã¯120ãã¬ãŒã ïŒ2ç§ïŒåŸã«èµ·åããŸãã ã¢ã©ãŒã ã¯é¢æ°ããŸãã¯ãªããžã§ã¯ãã€ãã³ãã§ãããã¹ãããã«ãŠã³ã¿ãŒã0ã«éãããšããã«èµ·åããŸããä»ã®ãã¹ãŠã®ã€ãã³ããšåæ§ã«ãAddã€ãã³ããä»ããŠè¿œå ãããŸãã ããã§ãã¢ã©ãŒã [0]ã«è¿œå ããããžãã¯ãç»é²ããå¿ èŠããããŸããããŸãããã©ã³ããæ®åœ±ãããã®ãäœæããŸãããã
ãµã€ãºãšäžå¿ã16x16ã®æ°ããspr_bulletã¹ãã©ã€ããäœæããŸãã 次ã«ãæ°ãão_bulletãªããžã§ã¯ããäœæããæ°ããäœæããã¹ãã©ã€ãã«èšå®ããŸãã Createã€ãã³ãã§ãã³ãŒãhspeed = 7ãè¿œå ããŸãã åã®ãªããžã§ã¯ããšåãã§ãã ãã®è¡ã§ã¯ããªããžã§ã¯ããæ°Žå¹³é床7ïŒhspeed =æ°Žå¹³é床ã誰ããç解ã§ããªãå ŽåïŒã§ç§»åããããšãæå®ããŸãã ããã¯ãåãªããžã§ã¯ãã®çµã¿èŸŒã¿ããããã£ã§ãã ãŒã以å€ã®å€ãå²ãåœãŠããšããã®ãªããžã§ã¯ãã¯åã¹ãããïŒã¹ãããïŒã§æå®ããããã¯ã»ã«æ°ïŒãã®äŸã§ã¯ãå³ã«7ïŒç§»åãå§ããŸãã hspeed = -7ã«èšå®ããå Žå; -ãªããžã§ã¯ãã¯ã¹ãããããšã«-7ãã¯ã»ã«ç§»åããŸãã å³ããå·Šã«ç§»åããŸãã
ããã ãã§ãão_unit_shooterãªããžã§ã¯ãã«æ»ã£ãŠãæ°ããã€ãã³ã-ã¢ã©ãŒã 0ãäœæããŸãããã®ã€ãã³ãã§èšè¿°ããã³ãŒãã¯ãCreateã€ãã³ãã§äœæããã«ãŠã³ã¿ãŒãå®è¡ãããŠãããšãã«çºçããŸãã Alarm 0ã€ãã³ãã§ã¯ãæ€ç©ãæŸã€ã匟䞞ãïŒå ã®ãšã³ããŠè±ïŒãäœæããŸãã 次ã®ã³ãŒããè¿œå ããŸãã
/// shoot var b = instance_create(x + sprite_width/2, y, o_bullet); b.depth = depth + 1; alarm[0] = room_speed * 2;
ãã®ã³ãŒããåæããŸãããã
/// shootã¯ã€ãã³ãã«è¡ããšãã«è¡šç€ºãããåãªãã³ã¡ã³ãã§ãã ããã©ã«ãã§ã¯ããã³ãŒãã®äžéšãå®è¡ããããšè¡šç€ºãããŸãããããŸãæçã§ã¯ãããŸããã ãããã£ãŠãã³ãŒããšãã£ã¿ãžã®åãæ¿ãã«æéã浪費ããªãããã«ããã®ãããªã³ã¡ã³ããèšè¿°ããããšããå§ãããŸãã
var b = instance_createïŒx + sprite_width / 2ãyão_bulletïŒ;
var b-ãã®ã€ãã³ãã§ã®ã¿äœ¿çšã§ããããŒã«ã«å€æ°ã宣èšããŸãã ã€ãã³ããå®äºãããšãã¡ã¢ãªã解æŸããããã®å€æ°ã«ã¢ã¯ã»ã¹ã§ããªããªããŸãã
instance_createïŒx + sprite_width / 2ãyão_bulletïŒ; -ãããã£ãŠããªããžã§ã¯ãã®æ°ããã€ã³ã¹ã¿ã³ã¹ãäœæããxã«æ²¿ã£ã座æšã«é 眮ããŸãïŒx + sprite_width / 2ãy-yã«æ²¿ã£ãŠã ãã®å Žåãxãšyã¯èŠªãªããžã§ã¯ãã®åº§æšo_unit_shooterã§ãã o_bulletã¯ãäœæãããªããžã§ã¯ãã§ãã
b.depth = depth + 1; -ãã®è¡ã¯ão_bulletã®æ°ããäœæãããã€ã³ã¹ã¿ã³ã¹ão_unit_shooterãã1å±€äžã«ãªãããšãæå³ããŸãã
æåŸã®è¡ã¯ãã¢ã©ãŒã [0]ãåã³éå§ããããšãæå³ããŸã-ãã©ã³ãã¯åžžã«æ®åœ±ããå¿ èŠããããŸãã
èŠããŠããããã«ããªãªãžãã«ã§ã¯ãç¹å®ã®ã»ã«ã«ã®ã¿æ€çãé 眮ã§ããŸãã æ€ç©ã眮ãããšãã§ããç¯å²å ã§èŠèŠçã«æ確ã«ããããã«ãèæ¯ãäœæãããããéšå±ã§åããŸãã [èæ¯]-[èæ¯ã®äœæ]-[èæ¯ã®èªã¿èŸŒã¿]ãå³ã¯ãªãã¯ããŠãç®çã®ç»åïŒ64x64ãã¯ã»ã«ãªã©ïŒãéžæããbg_grassãåŒã³åºããŸãã éšå±ïŒrm_gameïŒã®[èæ¯]ã¿ãã«ç§»åãã1ç§åã«äœæããèæ¯ãéžæããŸãã ç»åã®ããã«ãªã£ãŠããªãå Žåã¯ãããã¯ã¹ããã§ãã¯ããŸãã

ããã§ãåæåãè¡ãäœããã®çš®é¡ã®éå§ãªããžã§ã¯ããå¿ èŠã§ãã æ°ãããªããžã§ã¯ããäœæãão_gameãªã©ã®ååãä»ããŸãã ãã®ãªããžã§ã¯ãã¯ããã£ãŒã«ãã®ã¯ãªãã¯ã«å¿çããŸãã ãããè¡ãã«ã¯ãã€ãã³ããè¿œå ããŸã-ããŠã¹->ã°ããŒãã«ããŠã¹->ã°ããŒãã«å·ŠãªãªãŒã¹ã éåžžã®ããŠã¹ã€ãã³ãã¯ããªããžã§ã¯ããçŽæ¥ã¯ãªãã¯ããããšãæå³ããŸããão_gameã«ã¯ã¹ãã©ã€ã+ãã¹ã¯ãªã©ããªãããã§ãã ãã¬ãŒã€ãŒã競æå Žã®ä»»æã®ãã€ã³ããã¯ãªãã¯ããå¿ èŠãããããã¹ãŠã®ã¯ãªãã¯ã€ãã³ãããã£ããããå¿ èŠããããŸãã ãããGlobal Mouseã®æ©èœã§ãã ã°ããŒãã«å·ŠãªãªãŒã¹ãšã¯ãã²ãŒã ãŠã£ã³ããŠå ã®ã©ããã§ã¿ããã¹ã¯ãªãŒã³äžã§ããŠã¹ã¯ãªãã¯ãŸãã¯ã¿ãããè¡ãããããšãæå³ããŸãïŒæãé¢ããšã€ãã³ããçºçããŸãïŒã
ãã®ã€ãã³ãã«æ¬¡ã®ã³ãŒããè¿œå ããŸãã
var tBgWidth = background_get_width(bg_grass); var tBgHeight = background_get_height(bg_grass); var iX = mouse_x - mouse_x % tBgWidth + tBgWidth; var iX = mouse_x - mouse_x % tBgWidth + tBgWidth/2; var iY = mouse_y - mouse_y % tBgHeight + tBgHeight/2; if (instance_position(iX, iY, o_unit_parent) != noone){ exit; } instance_create(iX, iY, o_unit_shooter);
æäœåŸã®ã»ãã³ãã³ã¯çç¥ã§ããŸãããã³ãŒãã®ããžãã¯ã¯ããããå€æŽãããããšã©ãŒã¯çºçããŸããã ããããè³ããããšãã§ãããªãããããããªãã§ãã ããã ã¯ãããã身è¿ã§ãã
æåã®4è¡ã§ã¯ãããŒã«ã«å€æ°ã宣èšããŠããŸãã background_get_widthãbackground_get_height-èæ¯ã®å¹ ãšé«ããè¿ãçµã¿èŸŒã¿é¢æ°ã ã芧ã®ãšãããiXãšiYãèšç®ããã«ã¯ãã®ããŒã¿ãå¿ èŠã§ãã iXããã³iY-ãããã¯ão_unit_shooterãªããžã§ã¯ããã€ã³ã¹ã¿ã³ã¹åãã座æšã«ãªããŸãã mouse_xãmouse_y-ããŠã¹ã«ãŒãœã«ïŒæïŒã®çŸåšã®åº§æšãæ ŒçŽãããã²ãŒã ã¡ãŒã«ãŒã®çµã¿èŸŒã¿ã°ããŒãã«å€æ°ïŒã€ãŸããã©ãããã§ãã¢ã¯ã»ã¹ã§ããå€æ°ïŒã ãªããªã ã°ããŒãã«å·ŠãªãªãŒã¹ã€ãã³ãã§äœæ¥ãããŠãŒã¶ãŒãããŠã¹ã®å·Šãã¿ã³ãé¢ããïŒæãé¢ããïŒæåŸã®åº§æšãä¿åããŸãã çµæãå€æ°iXãiYã«å²ãåœãŠãããæ°åŠæŒç®ã¯ão_unit_shooterãªããžã§ã¯ãã®ã€ã³ã¹ã¿ã³ã¹ãããã¯ã°ã©ãŠã³ãã»ã«bg_grassã®çãäžã«äœçœ®ãã座æšãèšç®ããããã«å¿ èŠã§ãã ã€ãŸã Plants Vs Zombiesã§ã¯ãç¹å®ã®å Žæã«ã®ã¿æ€ç©ãé 眮ããããšã¯ã§ããŸããããä»»æã®å Žæãã¯ãªãã¯ãããšæ€ç©ãé©åãªå Žæã«é 眮ãããããšã«æ³šæããŠãã ããã ãããäžèšã®ã³ãŒãå šäœã§ãã
instance_positionïŒiXãiYão_unit_parentïŒããã§ãã¯ããïŒ= Nooneã¯ã芪ãªããžã§ã¯ãão_unit_parentã§ããã€ã³ã¹ã¿ã³ã¹ïŒãªããžã§ã¯ãã®ã€ã³ã¹ã¿ã³ã¹ïŒã®åº§æšiXãiYãèŠããšããæå³ã§ãã ç¶æ¿å¯èœãªãŠãããã¯o_unit_shooterãããªãããã競æå Žã«o_unit_shooterã€ã³ã¹ã¿ã³ã¹ããããã©ããã確èªããŸãããæ°ãããŠãŒã¶ãŒãŠããããè¿œå ããŠãã³ãŒããæ©èœããããã«o_unit_parentããã§ãã¯ã«æžã蟌ã¿ãŸãã nooneïŒãno oneãããïŒã¯ãä»ã®èšèªã§ã¯äžçš®ã®ãã«é¡äŒŒäœã§ãã
exit-ã€ãã³ãã®å®è¡ãäžæããã³ãŒãã ã€ãŸã iXãiY座æšã«æ¢ã«ãŠããããããå Žåãexitãããªã¬ãŒããão_unit_shooterã€ã³ã¹ã¿ã³ã¹ã¯äœæãããŸããã åŸç¶ã®ãã¹ãŠã®ã³ãŒãã®å®è¡ãäžæããŸãã ããã¯ã2ã€ã®ãŠãŒã¶ãŒãŠãããã1ã€ã®ã»ã«ã«åãŸããªãããã«ããããã«å¿ èŠã§ãã
ããŠãæåã®æµãè¿œå ããæãæ¥ãŸããã æ°ãããªããžã§ã¯ããäœæããããŒã¹ã®èŠªãªããžã§ã¯ããå床äœæããŸãã o_enemy_zombieããã³o_enemy_parentãåŒã³åºããŸãããããã¯èŠªã«ãªããŸãã spr_enemy_zombieã¹ãã©ã€ããäœæããäžå€®ã«é 眮ããŠo_enemy_zombieãå²ãåœãŠãŸãã
ãã¹ãŠã®æµã®ç¹æ§ãæ€ç©ã«åãã£ãŠããéããCreateã€ãã³ãã®o_enemy_parentã«æ¬¡ã®ã³ãŒããäœæããŸãã
cHspeed = -4; hspeed = cHspeed; HP = 10; canAttack = true;
cHspeedã¯ãhspeedã«å²ãåœãŠãå€ãæã€ãŠãŒã¶ãŒå®çŸ©å€æ°ã§ããããã§ã«æ€åºããŠããŸãã ãªãåã«hspeed = -4ãšæžããªãã®ã§ããïŒ -åŸã§åç §ããŠãã ããã
以åã«varæ§æãä»ããŠãŠãŒã¶ãŒå€æ°ã宣èšããŸããããããã§ã¯å®£èšããŸããã cHspeed = -4ã®éãã¯äœã§ããïŒ ããã³var cHspeed = -4;ïŒ
ç°¡åã§ã-æåã®ã±ãŒã¹ã§ã¯ãå€æ°ã¯ãã®ãªããžã§ã¯ãã®ã³ãŒãã®ã©ãããã§ãã¢ã¯ã»ã¹ã§ããä»ã®ãªããžã§ã¯ãããã¢ã¯ã»ã¹ã§ããŸãããã¢ã¯ã»ã¹ããŠãããªããžã§ã¯ãã«èšåããããšãå¿ããªãã§ãã ããã ä»ããããæãäžããå¿ èŠã¯ãããŸããã ãã®å€æ°ã¯ããªããžã§ã¯ãã宣èšãããŠããã€ã³ã¹ã¿ã³ã¹ãååšããéãã£ãšååšããŠããããšã«æ³šæããŠãã ããã var cHspeed = -4ã®å Žå; äœæãããã€ãã³ãã®æéäžã®ã¿å©çšã§ããŸãã
å®éãå¥ã®ãªããžã§ã¯ãããã¢ã¯ã»ã¹ããããšãã§ããŸãããäœæãããã€ãã³ããæ¢ã«çµäºãããšãã«å¥ã®ãªããžã§ã¯ãããã¢ã¯ã»ã¹ãããšããšã©ãŒãçºçããŸã-ã¡ã¢ãªããã¯æ¢ã«nullãã€ã³ã¿ã¢ã³ããŒãã
èªåã§hspeedãwspeedé¢æ°ãæ°ã«å ¥ããªãå Žåã¯ãStepã€ãã³ãã§xãŸãã¯yã®å€ãå€æŽããããšã§èªåã§å®è£ ã§ããŸãã ãããã®æ©èœã¯ããªãã®ããã«ãããè¡ããŸãã
HPã¯ãæµã®ããããã€ã³ãã®æ°ãæ ŒçŽããå¥ã®å€æ°ã§ãã åã€ã³ã¹ã¿ã³ã¹ã¯ãã®å€æ°ããææãããŸãããæµã®çš®é¡ããšã®ããããã€ã³ãã®æ倧æ°ã¯ç°ãªããŸãã ãã®å€ãäœããã®æ¹æ³ã§ãªãŒããŒã©ã€ã/åå®çŸ©ããå¿ èŠããããŸãã ãŸãã¯ããã¹ãŠã®æµã«åãæ°ã®ã©ã€ãïŒ100ãªã©ïŒãèŠæ±ããæµãåãããã¡ãŒãžãäŸåããé²è¡ã®æŠå¿µãå°å ¥ã§ããŸãããä»ã§ã¯ãããè€éåããæå³ã¯ãããŸãããïŒ ãããã£ãŠã1ã€ã®å€æ°-HPã®ã¿ã管çããŸãã
ã²ãŒã ã¡ãŒã«ãŒã§äœ¿çšãããèšèªã§ããgmlïŒå€§æåãšå°æåã¯åºå¥ãããŸãïŒãHPãhPãHpãããã³hpã¯ç°ãªãå€æ°ã«ãªãããšã«æ³šæããŠãã ããã
canAttackã¯ãå€trueïŒtrueïŒãå²ãåœãŠãåãªãå€æ°ã§ãã ãšãããããæžããŠå¿ããŠãã ããã
æµããšã«ç°ãªãHPå€ããããããäœããã®æ¹æ³ã§ãã®å€ãåå®çŸ©ããå¿ èŠããããŸãã ãšãŠãç°¡åã§ãã o_enemy_zombieãªããžã§ã¯ãã«ç§»åããCreateã€ãã³ãã«å¯Ÿããåå¿ãäœæããŠãã³ãŒããèšè¿°ããŸãã
event_inherited(); HP = 20;
é¢æ°event_inheritedïŒïŒ; ç¶æ¿ãæ±ããŸãã ã€ãŸã o_enemy_zombieãã³ãŒããå®è¡ããŸãïŒ
cHspeed = -4; hspeed = cHspeed; HP = 10;
ãã®é¢æ°ããã€ã³ããŒããããŠãããè¡ãå®è¡ãããå€-HP = 20;
ã€ãŸã å®éãCreateã€ãã³ãã®æåŸã«ão_enemy_zombieãªããžã§ã¯ãã«ã¯æ¬¡ã®ããããã£ããããŸãã
cHspeed = -4; hspeed = cHspeed; HP = 20;
é¢æ°event_inheritedïŒïŒãå¿ããå Žå; ãŸãã¯ã芪ãªããžã§ã¯ãão_enemy_zombieãªããžã§ã¯ãã«æå®ããã®ãå¿ãããšãæµã¯ç§»åããããã®ãªããžã§ã¯ãã®cHspeedå€æ°ã«ã¢ã¯ã»ã¹ããããšãããšãšã©ãŒã衚瀺ãããŸãã
çŽ æŽããããå¥ã®ã¿ã€ãã®æµãäœæãããå Žåãäœæã€ãã³ãã§åãããšãæžããå¿ èŠãªHPã®éãå€æŽããŸãã
event_inherited(); HP = 100;
ãŸã³ãã«ã¯ã©ã€ããã€ã³ãããããããæ€ç©ã®äžã«ããå¿ èŠããããŸãã ã³ãŒãHP = 20ão_unit_parentãªããžã§ã¯ãã®Createã€ãã³ãã«èªåã§è¿œå ããŸãã ããã³æååevent_inheritedïŒïŒ; o_unit_shooterãªããžã§ã¯ãã®Createã€ãã³ãã§ã
ç¥ã£ãŠãïŒ
Createã€ãã³ãã«äœããåå®çŸ©ããŠè¿œå ããå¿ èŠããªãå Žåã¯ãã³ãŒãevent_inheritedïŒïŒãè¿œå ããŸãã å¥ã®ããžãã¯ããªããã°ãã€ãã³ãã¯äžèŠã§ã-Game Makerããããè¡ããŸãã äœæã ãã§ãªããä»ã®ã€ãã³ãã§ãåãããšãèšããŸãã
ããŠãç§ãã¡ã®ãŸã³ãã¯çŸåšãªã³ã«ãªã£ãŠããŸããã匟䞞ã«ãšãããŠããããæ€ç©ã¯ãããé ãããŸããã ãŸããæåã®åé¡ã解決ããŸãã o_bulletã«ç§»åããŠãã€ãã³ãã«å¯Ÿããæ°ãããªã¢ã¯ã·ã§ã³ãäœæããŸããã-ã€ãã³ãã®è¿œå ->è¡çª-> o_enemy_zombieã ãã®ã€ãã³ãã¯ão_bulletãšo_enemy_zombieãäºãã«è¡çªãããšãã«ããªã¬ãŒãããŸãã 競åã¯ãèšäºã®åé ã§èªãã ãã¹ã¯ã«ãã£ãŠãã§ãã¯ãããŸãã ã³ãŒããè¿œå ããŸãã
with(other){ HP -= 5; if (HP <= 0){ instance_destroy(); } } instance_destroy();
ããã¯éåžžã«èå³æ·±ãç¹ã§ãã otherã¯ãã€ãã³ãã®ãã®æç¹ã§è¡çªãçºçãããªããžã§ã¯ãã®ã€ã³ã¹ã¿ã³ã¹ã§ãã åœç¶ããªããªã ãã®ã³ãŒãã¯ão_enemy_zombieãªããžã§ã¯ãã®ã€ã³ã¹ã¿ã³ã¹ãšè¡çªããå Žåã«çºçãããã®ä»ã®å Žåã¯o_enemy_zombieã€ã³ã¹ã¿ã³ã¹ã®ã¿ãçºçããŸãã
withïŒïŒ{}ã³ã³ã¹ãã©ã¯ãã䜿çšããŠããã®ä»ã®èŠçŽ ã«ã¢ã¯ã»ã¹ããŸãã {}å ã§çºçãããã¹ãŠã¯ããªããžã§ã¯ãã®ãã®ã€ã³ã¹ã¿ã³ã¹ã«ã®ã¿é©çšãããŸãã ãããã£ãŠãHP-= 5; -ããã¯ãæµãã5ã©ã€ããã€ã³ããåŒãããã®ã§ãã ifïŒHP <= 0ïŒ{}ã§ã¯ããã®ç¹å®ã®ãªããžã§ã¯ãã®ããããã€ã³ãã®æ°ãæ¯èŒããŸãã éåžžã®å€æ°å®£èšãšvarãä»ããå€æ°ã®éãã«ã€ããŠå°ãäžã§è©±ããããšãæãåºããŠãã ããã ãã®äŸã§ã¯ãç¶æ³ãæçµçã«æããã«ããå¿ èŠããããŸãã ãªããªã HPå€æ°ã¯varãä»ããŠå®£èšãããŠããªãããããã€ã§ã䜿çšã§ããŸãã ãããã£ãŠãwithã³ã³ã¹ãã©ã¯ãã䜿çšããŠã¢ã¯ã»ã¹ã§ããŸãã å¥ã®ãªããžã§ã¯ãã®å€æ°ã«ã¢ã¯ã»ã¹ããå¥ã®æ¹æ³ã¯æ¬¡ã®ããã«ãªããŸãã
other.HP -= 5; if(other.HP <= 0){ with(other){ instance_destroy(); } } } instance_destroy();
ããããç¹ã«ããžãã¯ãå¢ããå Žåã¯ããã®æ¹æ³ã§å€æ°ã«ã¢ã¯ã»ã¹ããã®ã¯ããŸã䟿å©ã§ã¯ãããŸããããããã§ãå Žåã«ãã£ãŠã¯é©çšã§ããŸãã
Createã€ãã³ãã§ã¯ãªãã宣èšããåã«ã¢ã¯ã»ã¹ããã³ãŒãã§å€æ°ã宣èšããå Žåãå€æ°ããããŒã¿ãèªã¿åãããšãããšãšã©ãŒãçºçããããšãå¿ããªãã§ãã ããã
é¢æ°instance_destroyïŒïŒ;ãç解ããããã«ãè±èªã®é«åºŠãªç¥èã¯å¿ èŠãããŸããã ãªããžã§ã¯ãïŒã€ã³ã¹ã¿ã³ã¹ïŒã®ãã®ã€ã³ã¹ã¿ã³ã¹ãåé€ããŸãã
ãããã£ãŠããã®ã³ãŒãã¯ãã¹ãŠãè¡çªã§ãŸã³ããã5ã€ã®ã©ã€ããã€ã³ããååŸãããããã0以äžã«ãªã£ãå ŽåããŸã³ããç Žå£ããããšãæå³ããŸãã çµæã«é¢ä¿ãªããæåŸã«åŒŸäžžãåé€ããŸãã ã©ããç°¡åã§ãã äžè¬ã«ããŸã³ãã«èªåã®å¥åº·ç¶æ ãç¬ç«ããŠç£èŠãããæ¹ãããããè¯ãã§ãããããä»ã®ãšããèå³ã¯ãããŸããã ããããããã¯
ç§ãã¡ã®ãŸã³ãããã¡ãŒãžãåããã ããªããããã¯ééã£ãŠããã§ãããã ãã¡ãŒãžãäžããèœåãè¿œå ããå¿ èŠããããŸãã ãŸãão_enemy_parentãªããžã§ã¯ãã®Createã€ãã³ãã«æ°ããå€æ°ãè¿œå ããŸã
isActive = true;
ããã»ã©ã話ãããStepã€ãã³ãã«ã€ããŠç¥ããŸãããã ãã®ã€ãã³ãã¯ãã¬ãŒã ããšã«çºçããŸãã ãã¹ãŠãã·ã³ãã«ã§ãã room_speedã60ã®å Žåããã®ã€ãã³ãã¯æ¯ç§çŽ60åçºçããŸãã ãã®ã³ãŒãão_enemy_zombieãªããžã§ã¯ãã®Step-> Stepã€ãã³ãã«è¿œå ããŸãã
if (!isActive) exit; var tBgWidth = background_get_width(bg_grass); var leftCellCenterX = x - x % tBgWidth - tBgWidth/2; var frontEnemy = instance_position(leftCellCenterX, y, o_unit_parent); if (frontEnemy != noone){ var frontEnemySprtWidth; with(frontEnemy){ frontEnemySprtWidth = sprite_width; } if (x - sprite_width/2 - frontEnemy.x - frontEnemySprtWidth/2 <= 12){ hspeed = 0; if (!canAttack){ exit; } canAttack = false; alarm[0] = room_speed * 1.2; // cantAttack -> true; with(frontEnemy){ HP -= 5; if (HP <= 0){ instance_destroy(); } } } }else{ hspeed = cHspeed; }
ããã«äœã®åé¡ããããŸãã;ã»ãšãã©ãã¹ãŠã®ãã¶ã€ã³ã¯ãã§ã«ããªãã«éŠŽæã¿ããããŸãã
ifïŒïŒisActiveïŒexit; -ãªããžã§ã¯ããã¢ã¯ãã£ãã§ãªãå Žåãã€ãŸãããªããžã§ã¯ããéæ¢/å é»/ã¹ã€ã³ã°ããå Žåããã®ã€ãã³ãã¯å®è¡ãããŸããã 次ã®2è¡ã§ã¯ãã€ã³ã¹ã¿ã³ã¹ã®äžå¿ãçŸåšäœçœ®ããŠããã»ã«ã®å·ŠåŽã«ããã»ã«ã®äžå¿ã®åº§æšãååŸããŸãïŒx-ã¯åç¹ã®åº§æšãè¿ããã¹ãã©ã€ãã®äžå¿ã«èšå®ãããŠããããšãæãåºããŠãã ããïŒã 次ã«ããŠãŒã¶ãŒãŠãããã座æšïŒleftCellCenterXãyïŒã«ãããã©ããã調ã¹ãŸãã ããã«äœããããã°ãåŸç¶ã®ããžãã¯ãçºçããŸãããããã«ã€ããŠã¯ããã«ãäœããªãå Žåã¯ãcHspeedå€æ°ã®å€ã«hspeedãå²ãåœãŠãŸããããã¯ãCreateã€ãã³ãã§äœæããŸãã ããã§åœ¹ç«ã¡ãŸããã ãã®èåŸã«ããæå³ã¯ãç§ãã¡ã®ãŸã³ããæ€ç©ãæ»æããŠç Žå£ããããã«åæ¢ããå Žåãéäžã§ç¶ç¶ããªããã°ãªããªããšããããšã§ãã ãã¡ãããå€æ°cHspeedãå ¥åããããšã¯ã§ããŸããããé床ãèšå®ããå ŽæãèŠããŠããå¿ èŠããããŸãããããã¯å¿ããããŸãã
ããã¯ããŸã³ãã®éã«äœããªããã°ãä»ç§ãã¡ãæŠãã«çŽé¢ããŠããç¬éã«æ»ããŸãã æåã®è¡ã¯éåžžã«èå³æ·±ããã®ã§ããããšãããããŸããã å®éãfrontEnemyã€ã³ã¹ã¿ã³ã¹ã§ããŒã«ã«å€æ°frontEnemySprtWidthã宣èšããããšã§ãããã«å€ãå²ãåœãŠãŠããŸãã ããã°ã©ãã³ã°ã«ç²ŸéããŠãã人ã¯èšãã§ããããããã®å Žåãç§ãã¡ã¯ãŸã³ãã®å€æ°frontEnemySprtWidthãåç §ããŠããã®ã§ã¯ãªããååã§ãããfrontEnemyã€ã³ã¹ã¿ã³ã¹ã®å€æ°ãåç §ããŠããŸãã ããã§ã¯ãããŸãããå®éã«ã¯ãããŒã«ã«å€æ°ïŒvarã§å®£èšïŒããfrontEnemyã€ã³ã¹ã¿ã³ã¹å ããã§ãããã®ã€ãã³ãå ã®ã©ãã«ã§ãèŠããããã«ãªããŸãã ãããã£ãŠãã³ãŒãã«ãšã©ãŒã¯ãããŸããããŸã³ãå éšã§ããŒã«ã«ã«å®£èšãããå€æ°ãå®éã«åç §ããŸãã ãã®ç¹ãç解ããŠããªãå Žåãå®éšãããããã«ããèªããšããã¹ãŠãå®å šã«èª¬æãããŠããã®ã§ãããã«å ã«é²ã¿ãŸãã
frontEnemySprtWidthãããŸã³ãã®å·ŠåŽã®ã»ã«ã«ãããŠãŒã¶ãŒïŒæ€ç©ïŒã®ãŠãããã®ã¹ãã©ã€ãã®é·ãïŒå¹ ïŒã«èšå®ããŸãã var frontEnemySprtWidth = sprite_get_widthïŒspr_unit_shooterïŒ;ãçãããšãã§ããå Žåãæåã«ç解ããããã«ãªããã®ãããªè€éãªæ§é ããããã¯ããå¿ èŠãããã®ãââããšããããšã§ãããã çãã¯ç°¡åã§ã-çŸåšã1ã€ã®æ€ç©ããããã©ã®ã¹ãã©ã€ããé©çšããããããã£ãŠããŸãããæ°ããã¿ã€ãã®ãŠãããïŒããã¯ãªãªã©ïŒãè¿œå ãããšãã¯ãé¢åãªã¹ã€ããæ§é ããã§ã³ã¹ããŠãã©ã®ãããªãªããžã§ã¯ããç®ã®åã«ããã®ãã確èªããå¿ èŠããããŸããã®åé¡ã¯åçŽã«è§£æ±ºãããŸãã
次ã«ããŠãŒã¶ãŒãŠãããã®å³ç«¯ã®ãã€ã³ããšãŸã³ãã®å·Šç«¯ã®ãã€ã³ãéã®è·é¢ã12ãã¯ã»ã«æªæºã§ãããã©ããã確èªãããŸã³ããåæ¢ãããŸã³ããæ»æã§ãããã©ããã確èªããŸãïŒo_enemy_parentãªããžã§ã¯ãã®Createã€ãã³ãã§ä»¥åã«äœæãããcanAttackå€æ°ã®å€ã確èªããŸãïŒçŸåšæ»æããããšã¯äžå¯èœã§ããã次åã¯room_speed * 1.2ãã¬ãŒã ïŒ60 * 1.2以éïŒã§å®è¡ã§ãããšèšãã³ãŒã-ã¢ã©ãŒã [0]ã§ãããè¡ããŸãïŒå¯Ÿå¿ããã€ãã³ãã«èªåã§è¿œå ããŸãïŒã¢ã©ãŒã 0 ïŒof o_ene my_parentãã³ãŒãã®èšè¿°canAttack = true;ïŒã æ»æãå¯èœãªå Žåã¯ããã©ã³ããã5ã€ã®ã©ã€ããã€ã³ããååŸãããŸã çããŠãããã©ããã確èªããŸããçããŠããªãå Žåã¯ç Žå£ããŸãã
ããŠãæµã¯å®å šã«æºåãã§ããŠããŸã-æ€ç©ãç Žå£ããå Žåã圌ã¯åããæ»æããåãç¶ããŸããã1ã€ã®æ¬ ç¹ããããŸã-圌ã¯ååšããŸããã æµã®èª¬æã ããäœæããŸãããä»åºŠã¯ã競æå Žã«ãŸã³ããé 眮ããå¿ èŠããããŸãã o_gameãªããžã§ã¯ãã®Createã€ãã³ãã«æ»ããŸãã ã³ãŒããè¿œå
ã¢ã©ãŒã [0] = room_speed; //æµãçæããŸã
ã€ãŸã 60ãã¬ãŒã åŸãã¢ã©ãŒã 0ãæ©èœãããŸã³ããäœæãããŸãããïŒ ãã ãã®ã¢ã©ãŒã ã®ããžãã¯ã¯äœæããŠããŸããã ãŸããããã®ã³ãŒããç°¡åã§ãã
var tBgHeight = background_get_height(bg_grass); var eY = irandom(room_height - room_height % tBgHeight); eY = eY - eY % tBgHeight + tBgHeight/2; instance_create(room_width + sprite_get_width(spr_enemy_zombie)/2 + 1, eY, o_enemy_zombie); alarm[0] = room_speed * 3;
ãã¹ãŠãåçŽã§ã-ãããè€éã«ããã3ç§ïŒ60ãã¬ãŒã * 3ïŒããšã«X座æšã§o_enemy_zombieã€ã³ã¹ã¿ã³ã¹ãäœæããŸãïŒroom_width + sprite_get_widthïŒspr_enemy_zombieïŒ/ 2 + 1 i.e. ç»é¢å¢çã®å³åŽã«æ£ç¢ºã«1ãã¯ã»ã«ãã€ãŸã ãŸã³ãã¯æåã¯è¡šç€ºããããYã¯ã©ã³ãã ãªã»ã«ã§ãã æ¢ã«ç解ããŠããããã«ãroom_widthãšroom_heightã¯ãéšå±ã®å¹ ãšé«ãã§ãã ã€ãŸã ãããã800ããã³480ã
ããã¯ãã¹ãŠçŽ æŽãããããšã§ããã誰ãão_gameãªããžã§ã¯ãã®ã€ã³ã¹ã¿ã³ã¹ãäœæããå¿ èŠããããŸããããããªããšããšããœãŒãå šäœãæå³ãæããŸããã ããããæåŸã®ã¹ãããã¯éåžžã«ç°¡åã§ã-ã«ãŒã rm_game->ãªããžã§ã¯ã->ã¡ãã¥ãŒã§o_gameãéžæããã«ãŒã ã®ã©ãã«ã§ãé 眮ããŸãã 代æ¿ãªãã·ã§ã³ã¯æ¬¡ã®ããã«ãªããŸã-[èšå®]-> [äœæã³ãŒã]ã¿ãïŒ-ããã¯ããã®éšå±ã«ç§»åãããšãã«ããªã¬ãŒãããã³ãŒãã§ãïŒã è¡instance_createïŒ0,0ão_gameïŒãè¿œå ããŸãã
座æšã¯ä»»æã§ãã ããã§ãã²ãŒã ã¡ãŒã«ãŒãrm_gameã«ãŒã ãéå§ãããããå€ãã®ã«ãŒã ãããå Žåãã©ã®ã²ãŒã ã¡ãŒã«ãŒãéå§ãããããã©ã®ããã«æ±ºå®ãããã質åã§ããŸãã ãã¹ãŠããã€ãã®ããã«ã·ã³ãã«ã§ã-äžçªäžã®éšå±ãæåã«å§ãŸããŸãïŒããŠã¹ã§ãã©ãã°ããŠé åºãå€æŽã§ããŸãïŒã ããã«éå§ãããã®ã§ãä»ã¯ããã ãã§ãã
次ã®ããã«ãªããŸãã
æåã®ãšããœãŒãã¯çµãããŸããã ããã§ãšãããããŸããã²ãŒã ã®ãããã¿ã€ããäœæããŸããã æ®ãã¯ã»ãšãã©ãããŸãã-ããããæ¬æ Œçãªã²ãŒã ãäœãããã«ãããã¯æ¬¡ã®ããŒãã§è¡ããŸãã
ãã®ãšããœãŒãã§ã¯ãã§ããã ãå€ãã®æ©èœã䜿çšããŠãGame Makerã®åºæ¬æŠå¿µã«æ £ããŸããã ããã€ãã®ç¹ã¯ããŸãåççã§ã¯ãªããããçŽãããšãã§ããŸãããäžåºŠã«ãã¹ãŠã§ã¯ãããŸããã äœãèµ·ããŠããããæåã«ç解ããã«ã¯ãã¢ããã¥ã¢é¢šã«æžãæ¹ãè¯ããšæããŸãã
ã¬ãã¹ã³ãããããããã«ãäžéšã®èšç»ã§ã¯ãçŸåšã®ããŒãžã§ã³ã®Game Makerã¯å®å šã§ã¯ãªããå€ãã®ç¹ã«çæããå¿ èŠããããŸãããGame Makerã§ã¯æ®ãã®äœæ¥ãç°¡åã§ãã å°ãäžäŸ¿ã¯äŸ¡å€ããããŸãã
ãœãŒã¹ã³ãŒã
次ã®ãšããœãŒãã§ïŒ
-/çè«/ã¹ã¯ãªãã
-/çè«/ãããã°
-/ç·Žç¿/ãŠãããã²ãŸãã
-/ç·Žç¿/ããïŒå€ªéœïŒ
-/ç·Žç¿/æµã®æ³¢ã®çæ
-/ç·Žç¿/èåãæ©
-/ç·Žç¿/ãŸã³ããšæ€ç©ã®æ°ãããŠããã
-/çè«+å®è·µ/ããªããã£ãã€ã³ã¿ãŒãã§ã€ã¹
ååãšããŠãä»ã§ã¯ãã§ã«ç¿åŸããç¥èããç·Žç¿ã»ã¯ã·ã§ã³ã®ãã¹ãŠããã§ã«å®è¡ã§ããŸããããããããç¥èã®æè·ç©ãå¢ããããã«ãããè€éãªåœ¢åŒã§å®è£ ããŸãã