Latest Uploads
Invasion V ... prototype

rychan

Invasion V ... Prototype

rychan

Shields 64x64

Pakz

Ffs_Spam

Jayenkai

Hives Screen shot

rychan

Rpg Potion Sprites

Pakz

Code Snippets > Collisions and Physics ( Created 23 November 2016 | Last Edited 24 November 2016)

Water in 2d map by Pakz | No Votes
See water flow/flood in a level.
Written in
Monkey
lmb = poor water - rmb = place tile - mmb = erase tile/water.

Here a short video of it :
https://youtu.be/vtORT4-W91k

I have been spending time learning how to do water.

What happens in the code basically is. In the update a random position is chosen. If that position is water then see if you can move the drop down/left or right.
I added some code later to move water a little bit more sideways.

It took me a while to learn this. I first used a more complex way but found this simple way was a lot better.

It still probably needs more work.

Code for monkey 2

-->

Latest Comments

Posted : Saturday, 26 November 2016, 08:05
Pakz


I combined the water code with the mining map generator with ai. Still some work to be done but it is looking more interesting now.

https://youtu.be/Qqkc3IQ7C-Y

Homepage : http://cromdesi.home.xs4all.nl/
Posted : Saturday, 26 November 2016, 20:19
Stealth


That's really slick! *pun*

Homepage : http://strubhar.me
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 630|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Latest Posts
Puff Dog
spinal Mon 02:42
AGameAWeek : 2017 - Part One
Jayenkai Sun 14:32
Crystal Maze
rychan Sun 11:59
CSS-Me-Do - SoCoder2
Jayenkai Sun 08:08
Buy Zelda
Jayenkai Sat 08:34
Welcome Caton
steve_ancell Sat 04:53
Update All Objects in Array?
Jayenkai Sat 03:34
2D Array?
Jayenkai Sat 03:29
Cerberus X - the continuation of Monkey X
zzoom Fri 23:13
Delete Button on Showcases
Pakz Fri 09:13
More

Latest Items
Blog : Rewatching ''1 Litre of Tears''
Jayenkai Mon 02:52
Snippet : Twitter BBCode
Jayenkai Sun 02:44
Link : Learn C++
Pakz Sat 20:33
Dev-Diary : My Journey into NES Development
Jayenkai Thu 03:58
Showcase : A Civilization Clone v0.5
rychan Thu 03:27
News : Newsletter #320
Jayenkai Tue 18:47
Blog : sadas
hardcoal22 Tue 02:50
Showcase : Flappadiddle
Jayenkai Mon 08:20
Article : Cookie Information
rychan Sun 12:28
Dev-Diary : Wii to N64 adapter
spinal Sat 11:50
Link : MonkeyX code examples
Jayenkai Sat 06:42
Link : Available Languages
Jayenkai Thu 13:22
Blog : Mr Testo Tests
Socoder Tue 07:21
Showcase : Hives
zzoom Fri 16:10
More

Who's Online
Jayenkai
Mon, at 06:18
GfK
Mon, at 06:00
shroom_monk
Mon, at 05:58
steve_ancell
Mon, at 05:42
rockford
Mon, at 05:38
rychan
Mon, at 05:07
spinal
Mon, at 04:09
therevillsgames
Mon, at 03:23
Krakatomato
Mon, at 02:27
Pakz
Mon, at 02:14
Link to this page
Site : Jayenkai 2006-Infinity | MudChat's origins, BBCode's former life, Image Scaler.