推特用户 @javilopen 使用 GPT-4、DALL・E 3 和 Midjourney 编写了小游戏「愤怒的南瓜」(PS:如有雷同纯属巧合),其中 GPT-4 负责所有的编码工作,DALL・E 3 和 Midjourney 负责图形部分。

小伙伴们也可以试玩,还能自己创造关卡。不过,它目前还不支持手机端运行。

试玩地址:https://bestaiprompts.art/angry-pumpkins/index.html

接着来看这款「愤怒的南瓜」的实现流程和 prompt 细节。

首先是图形,这也是最简单的部分。以下是 prompt 分享:

标题屏幕(使用 GPT-4 里的 DALL・E 3):名为「Angry Pumpkins」电子游戏的横向主屏幕图片。设计参考「愤怒的小鸟」美术风格,但又有所不同。鬼屋、墓碑和蝙蝠等万圣节元素填充背景。游戏徽标位于中心顶部的显著位置,两侧是生气、虎视眈眈的南瓜造型。底部中央有一个「Play」按钮,周围环绕着阴森恐怖的雾气。

Photo of a horizontal vibrant home screen for a video game titled 'Angry Pumpkins'. The design is inspired by the 'Angry Birds' game aesthetic but different. Halloween elements like haunted houses, gravestones, and bats dominate the background. The game logo is prominently displayed at the center-top, with stylized pumpkin characters looking angry and ready for action on either side. A 'Play' button is located at the bottom center, surrounded by eerie mist.

01210141-2023-11-01T13:02:01.png

背景图(使用 Midjourney),作者使用了一张图片作为背景(并进行了多次修补),图片的 prompt 为:iPhone 截图中「愤怒的小鸟」的天际线,万圣节版,墓地,风格为浅海蓝宝石和橙色,新传统主义,kerem beyit, earthworks,木头,Xbox 360 图像,浅粉色和海军蓝 —— 比例为 8:5。”

Angry birds skyline in iPhone screenshot, Halloween Edition, graveyard, in the style of light aquamarine and orange, neo-traditionalist, kerem beyit, earthworks, wood, Xbox 360 graphics, light pink and navy --ar 8:5

另一张裁剪之后用来生成地面:2d 平台、石砖、万圣节、2d 电子游戏地形、2d 平台游戏、万圣节场景、类似于愤怒的小鸟、万圣节场景、截图、游戏资源 —— 比例为 8:5。

2d platform, stone bricks, Halloween, 2d video game terrain, 2d platformer, Halloween scenario, similar to angry birds, metal slug Halloween, screenshot, in-game asset --ar 8:5

接下来,就要生成游戏中的角色了,作者使用 Midjourney 完成了创作。

  • 万圣节南瓜,游戏精灵图,万圣节版,简易精灵图,2D,白色背景
  • 万圣节绿色怪物,憨态可掬,游戏精灵图,万圣节版,简易精灵图,2D,白背景
Halloween pumpkin, in-game sprite but Halloween edition, simple sprite, 2d, white background
Green Halloween monster, silly, amusing, in-game sprite but Halloween edition, simple sprite, 2d, white background

当然,游戏中的物体也是作者使用 Midjourne 制作的。作者创建了各种精灵图样式表,然后用 Photoshop/Photopea 裁剪并移除背景。对于小细节,作者使用 Midjourney 进行修补。

  • 木箱,物品资源精灵图,白色背景,游戏精灵图。
  • 骷髅骨,大型骨骼,物品资源精灵图,白色背景,游戏精灵图。
  • 长方形石头,物品资源精灵图,白色背景,游戏精灵图。
  • 木箱,大型骨骼,物品资源精灵图,白色背景,游戏精灵图。
  • 物品资源精灵图,木板,白色背景,游戏精灵图,类似「愤怒的小鸟」风格。
Wooden box. Item assets sprites. White background. In-game sprites
Skeleton bone. Large skeleton bone. Item assets sprites. White background. In-game sprites
Rectangular stone. Item assets sprites. White background. In-game sprites
Wooden box. Large skeleton bone. Item assets sprites. White background. In-game sprites
Item assets sprites. Wooden planks. White background. In-game sprites. Similar to Angry Birds style

最后编程部分使用了 GPT-4。作者表示,这个游戏的代码仅有 600 行,完全由 GPT-4 代写。

完整代码可见:https://bestaiprompts.art/angry-pumpkins/sketch.js