瀏覽代碼

Spawn a random seed wheen space key is hit

DricomDragon 4 年之前
父節點
當前提交
fdd30f76ef
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      main.cpp

+ 5 - 0
main.cpp

@@ -153,6 +153,11 @@ int main()
 							clearWorld(world);
 							drawWorld(world, tileSet, map);
 							break;
+						case SDLK_SPACE:
+							seed.randomize();
+							putSeed(seed, world);
+							drawWorld(world, tileSet, map);
+							break;
 					}
 				case SDL_MOUSEMOTION:
 					cursorPos.x = event.motion.x / BLOC_SIZE;