88031

How to make water pour in GML?

Question:

How can I make water pour from a flask in game maker where have obj_flask , obj_water , and obj_container. I want to make the obj_water pour from obj_flask into the obj_container.

Answer1:

This depends hugely on how you want to achieve this effect. You could for example have an animated sprite stretching from the flask to the container. Or you could create water droplet instances at a given time rate and let them be affected by gravity. Or you could use a particle system, but this usually gives you less control if you want to check if it actually hit the container.

I can show you how to make the second idea to get you started.

<strong>obj_jug</strong>

Step Event: execute code: x = mouse_x; y = mouse_y; if (mouse_check_button(mb_left)) { instance_create(x + 32, y + 8, obj_droplet); }

<strong>obj_droplet</strong>

Create Event: execute code: a = 1; v = 0; Step Event: execute code: v += a; y += v; if (y >= window_get_height()) { instance_destroy(); } Collision Event with object obj_container: destroy the instance

This will not give a great effect, but it will do what is being asked.

Recommend

  • How do I read this Swift syntax? [duplicate]
  • htaccess WWW to no-WWW not working
  • XSD: Allow any unknown element in any order
  • Applescript Droplet - Export Image Resolution of All Files in Folder/Subfolder as text file
  • r markdown biblio-style does not work
  • Interface Builder tutorial on how to customize UIButtons in Xcode 4.2
  • Removing Small Regions from a Binary Image
  • Three.js BufferGeometry vs Geometry for particles
  • Customizing slider track images
  • regular expression validation errors
  • five3d local3dtoglobal
  • Printing on citrix server
  • How to call functions from sprites in groups?
  • Setting a dynamic size for an Asp:Chart control
  • How to Optimize mach_msg_trap
  • How many View Controllers should I have in my game?
  • LNK1104: cannot open file 'kernel32.lib'
  • Invert string in Rust
  • Less Conflicting Session Manager for Zope 2
  • C#: Import/Export Settings into/from a File
  • Syntax error on tokens, AnnotationName expected instead - error on query
  • JSR-330 support in Picocontainer : @Inject … @Named(\"xxx)
  • How can I display the parent menu item's description using Wordpress walkers?
  • calculate gradient output for Theta update rule
  • How do I fake an specific browser client when using Java's Net library?
  • Sony Xperia Z Tablet not found by adb
  • How to get a value (ex: baseURL) in every Karate feature?
  • Does CUDA 5 support STL or THRUST inside the device code?
  • Validaiting emails with Net.Mail MailAddress
  • Timeout for blocking function call, i.e., how to stop waiting for user input after X seconds?
  • Comma separated Values
  • Windows forms listbox.selecteditem displaying “System.Data.DataRowView” instead of actual value
  • Proper folder structure for lots of source files
  • Error creating VM instance in Google Compute Engine
  • Hits per day in Google Big Query
  • how does django model after text[] in postgresql [duplicate]
  • Can Visual Studio XAML designer handle font family names with spaces as a resource?
  • How does Linux kernel interrupt the application?
  • How can I remove ASP.NET Designer.cs files?
  • Are Kotlin's Float, Int etc optimised to built-in types in the JVM? [duplicate]