Commits

Anonymous committed 06cc76b

exceptions for unitialized data

  • Participants
  • Parent commits e36bfeb

Comments (0)

Files changed (1)

     success := Some (loadWAV "data/sfx/success.wav")
   
   let play sfxref = match !sfxref with
-    | None -> ()
+    | None -> failwith "sound not initialized"
     | Some sound -> Sdlmixer.play_channel ~channel:0 sound
 end
 
     flag := Some (load_image ("data/images/flag/flag_" ^ color ^ ".png"));
     star_bullet := Some (load_image "data/images/bullet/bullet_star.png");
     dragon_bullet := Some (load_image ("data/images/bullet/bullet_dragon.png"));
-    player_bullet :=
-    Some (load_image ("data/images/bullet/bullet_" ^ color ^ ".png"))
+    player_bullet := Some (load_image 
+      ("data/images/bullet/bullet_" ^ color ^ ".png"))
   
   let blit dst dst_rect imgref = match !imgref with
-    | None -> ()
+    | None -> failwith "image not initialized"
     | Some image ->
         Sdlvideo.blit_surface ~dst_rect: dst_rect ~src: image ~dst: dst ()