Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Animations?

Author
Message
Tucker S
9
Years of Service
User Offline
Joined: 15th Oct 2010
Location:
Posted: 29th Oct 2010 04:10
I'm trying to make my character in my game look like he's swimming. Is there a way to put bubbles trailing behind my character?
bergice
13
Years of Service
User Offline
Joined: 5th Jun 2007
Location: Oslo,Norway
Posted: 29th Oct 2010 22:01
You could use transparent spheres, an animated image plane or particles. Depends how you want it to look and if its on the surface or below water.

51fa1db0ec7c4af52d93a6f5d0e86bc5


TheComet
12
Years of Service
User Offline
Joined: 18th Oct 2007
Location: I`m under ur bridge eating ur goatz.
Posted: 30th Oct 2010 01:00
Plains would be the best thing to go for. You can have static or animated images textured on them, and you can easily face them to the camera to make them look 3D

TheComet

Libervurto
14
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 30th Oct 2010 02:39
Have a look at the demo program which I think is called "Jetski", it should be in your myprojects folder. If I remember this has an effect like that.


Do oranges know what colour they are?
Tucker S
9
Years of Service
User Offline
Joined: 15th Oct 2010
Location:
Posted: 31st Oct 2010 19:12
i meant to say he's underwater.. sorry :/
Latch
14
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st Nov 2010 02:24
@Ticker S

The methods can be like other have posted above.

The way to do it might go like this:

1. Create a bunch of plane objects, maybe 10 to 25, depending on how many bubbles you want.

2. Texture each plane with a single bubble. The bubble texture would work best if it is just an outline of a bubble with a reflection, but see through with a black background. This is so we can use ghosting to make the bubble transparent

3. Ghost object on for all of the bubbles

4. This can be a tricky part. You don't want all of the bubbles to move in a big lump - all at once. You want them graduated. You can accomplish this in a couple of different ways:

- Upon creating them, stagger their y positions and hide each bubble as it is created.
- Set up and array and store a random life length time for each bubble.

5. Once you have the timing or the spacing figured out for the bubbles, you'll want to move them. Do this within it's own loop. This can be in a function or a subroutine.

The way to move them would be to:
-get the players x,y and z position
-decide on a speed that the bubble floats up
-decide on a maximum height and/or time that the bubble will float

loop through the bubbles
-if the bubble is just starting out (spawning), set it's initial position to the players position
-if the bubble was already spawned and is still alive (it hasn't reached the maximum height or it's life timer isn't up), add speed to the bubble's y position
-when the bubble reaches it max height or it's life time is up, respawn and continue looping

As the player moves, the bubble will start at the player's position. It will float up from there until it's time for it to respawn. So if the player moves away, the bubble will keep floating up where it was and new bubbles will be formed at the player. This loops over and over for an endless supply of respawning bubbles.

Enjoy your day.

Login to post a reply

Server time is: 2020-08-12 01:55:02
Your offset time is: 2020-08-12 01:55:02