Log in
Search
GameML File Sharing
USERNAME: gamemladmin@gmail.com PASSWORD: gamemlsite Upload Here: https://gameml.forumotion.com/GameML-File-Sharing-h3.htmPlease add only games.Simple 2D Rain Code-Lite
2 posters
:: Game Making :: Game Maker Help :: Code Database
Page 1 of 1
Simple 2D Rain Code-Lite
This is actually in my tutorial that I created, but it is not in code format there. First you need to have only 2-3 objects for this. An rain object and an object that creates the rain, also might need an object for the rain particle hitting the ground.
Rain creator step code:
Now the rainparticle's object creation code:
The rainparticle's collision(with ground) code. There are 2 options here you can:
If you choose the second option, then you will need a object for the rain splash, so here it is.
Creation code:
Animation End code:
So that's that Hope this help's out beggining Game Makers. If you need any help understanding this then ask.
Rain creator step code:
- Code:
instance_create(random(roomwidth+30),0,rainparticle) //This creates rain randomly across the room
Now the rainparticle's object creation code:
- Code:
motion_set(-110,35.5) //So simple just change 1st # to change direction, 2nd # to change speed
The rainparticle's collision(with ground) code. There are 2 options here you can:
- Code:
instance_destroy() //This is if there is no animation for the rain hitting the ground(not suggested as it makes the game look cheap)
- Code:
instace_change(rainsplash,1) // changes into rain animation
If you choose the second option, then you will need a object for the rain splash, so here it is.
Creation code:
- Code:
action_sprite_set(spr_rainsplash,0,0.2) //just adjust the speed(3rd #) until there are satisfactory results
Animation End code:
- Code:
instance_destroy()
So that's that Hope this help's out beggining Game Makers. If you need any help understanding this then ask.
Last edited by -js1210- on Wed Jul 22, 2009 7:02 pm; edited 1 time in total (Reason for editing : Stated that it was Lite compatable)
:: Game Making :: Game Maker Help :: Code Database
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|