dynamic water example

Post here your demos and examples with the source files.
Forum rules
Always post the games with a screenshot.
The file must have the ged and data files (complete game source)
Use the forum attachment to post the files.
It is always better to use the first post to put the game files

dynamic water example

Postby feral » Tue Jul 15, 2008 6:36 am

this is a rough attempt at dynamic water - it may help some of you think up new ideas.......

feel free to use it for your own games if you want..
note: becuase it uses a lot of transparency effects on BIG images... it will slow down your games,
so if you want to use it , think of slower game ideas rather then a high speed game..
fihsgrab.jpg
a screen grab from the screensaver
looks better in real life :( jpeg losses

water2.zip
ged files and data
(59.28 KiB) Downloaded 353 times



PS: i also used it to make a screensaver thingo
It started out to be a game idea... but then I got stuck and didn't know what do next.. writers block :oops:

attached is an exe of the screensaver idea as well

fish3.zip
(1.04 MiB) Downloaded 256 times


NOTE: I used my spritemaker program to make the rotated "fishes" and I also used it to create the dissolving "food block" sprite...

cheers
feral
Last edited by feral on Tue Jul 15, 2008 1:37 pm, edited 1 time in total.
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: dynamic water example

Postby segwego12 » Tue Jul 15, 2008 11:51 am

Does this wan't intel or is this broken cuz I have nVidia.
http://www.freewebs.com/primewaregames/

The Primeware Games website

Projects
Era of Rome: Done
segwego12
 
Posts: 167
Joined: Mon Jul 07, 2008 2:48 am
Location: My Website, please come to my website.
Score: 3 Give a positive score

Re: dynamic water example

Postby feral » Tue Jul 15, 2008 1:25 pm

segwego12 wrote:Does this wan't intel or is this broken cuz I have nVidia.


why ? what happens ? it should work on any platform ?
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: dynamic water example

Postby segwego12 » Tue Jul 15, 2008 1:32 pm

are there supposed to be fish cuz i can't see any of them. And i'm talking about my video card.
http://www.freewebs.com/primewaregames/

The Primeware Games website

Projects
Era of Rome: Done
segwego12
 
Posts: 167
Joined: Mon Jul 07, 2008 2:48 am
Location: My Website, please come to my website.
Score: 3 Give a positive score

Re: dynamic water example

Postby feral » Tue Jul 15, 2008 1:44 pm

sorry, I double posted this, because I meant to show the water example here only, as a ged ... and the "fish screensaver" in the development section..

which was silly ... I don't know what i was thinking :oops:

anyhow, both the water demo ged, (no fish) and the final exe (with fish) are now both here..see the first post

The water demo was only meant show an idea of how to do dynamic looking water

the fish thing was a game I was planning on ....and that exe is now here too...

tho if anyone wants to know how to do the fish thing I will clean up the code, and post that here as well..

cheers
feral
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: dynamic water example

Postby Thanx » Tue Jul 15, 2008 7:49 pm

Hey feral!
Those are absolutely great, both of them!
I'd be interested in the code for the fishy demo too... I can guess what your game idea was... :P
:D
The only thing I'd add to it is sound. With sound I'd really feel underwater with that thing on... :):D8):P
Cool!!
Cheerz!
Thanx
http://www.youtube.com/watch?v=XyXexDJBv58
http://www.youtube.com/watch?v=Be4__gww1xQ
These are me and playing the piano (second one with a friend/fellow student)
Hope you watch and enjoy!
User avatar
Thanx
 
Posts: 314
Joined: Sat Jan 26, 2008 10:07 pm
Location: Home sweet home! :)
Score: 24 Give a positive score

Re: dynamic water example

Postby feral » Wed Jul 16, 2008 12:20 am

The code for fishes now included, although a little rough, keep in mind this was meant to be the beginning of a game and is not complete...
FISH.zip
ged and data files
(258.28 KiB) Downloaded 206 times

also I added a sound file, but it doesn't work well on my PC.. press space to hear the sound... it may not work on yours either... but let me know.. it seems to be playing multiple copies of the same sound...

basically the fish are simply "homing missiles" with some random values thrown in..

hope it helps

feral
PS: I cut down the number of fish becuase it runs slow on my ancient PC , but if you want more, simply clone them, and in the collision event lower the number of "bites" need to finish the block ( if it disappears to fast with many fish)

PPS: if anyone makes a game using these ideas and want more background water bitmaps I am happy to make em, but only if you have a game made... :D
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: dynamic water example

Postby zygoth » Wed Jul 23, 2008 6:34 pm

I have been trying to make a fish really act like a homing missile by every frame changing its angle by +5 or - 5 depending on which would take less moves to reach the direction of the player. Is this making any sense at all? I have tried a lot of stuff, but I can't seem to get it to work- could somebody show me some code that would work?
Nova: 100% Vertigo/Mazeman: 100%
Visit my website to download them both! http://www.ketonegames.com
User avatar
zygoth
 
Posts: 140
Joined: Mon Jun 11, 2007 6:37 pm
Score: 5 Give a positive score

Re: dynamic water example

Postby zygoth » Wed Jul 23, 2008 7:21 pm

Never mind, guys, i figured out how to do it. This is great code for realistic homing missiles, and I've wanted to make it for a long time. Here it is:

if (angle >=181 && angle <=359)if(direction(x, y, player.x, player.y) >=angle)angle = angle + 4;
else
if(angle >= 181 && angle <=359)if(direction(x, y, player.x, player.y)<= angle - 180)angle = angle + 4;
else
angle = angle - 5;

if(angle <= 180 && angle >=0) if(direction(x, y, player.x, player.y) <= angle)angle = angle -5;
else
if(angle <= 180 && angle >=0) if(direction(x, y, player.x, player.y) >= angle + 180)angle = angle - 5;
else
angle = angle + 4;
angle = angle + 1;


yeah, it's huge and ugly, but it works perfectly. put into a fish from this demo instead of the angle = direction makes each fish into a realistic homing missile. I will try to upload the ged file but my computer never seems to like it when i try to post files.
Attachments
fish.zip
very cool
(431.24 KiB) Downloaded 181 times
Nova: 100% Vertigo/Mazeman: 100%
Visit my website to download them both! http://www.ketonegames.com
User avatar
zygoth
 
Posts: 140
Joined: Mon Jun 11, 2007 6:37 pm
Score: 5 Give a positive score

Re: dynamic water example

Postby feral » Wed Jul 23, 2008 11:56 pm

cool effect zygoth :D

an easier way to to do the same thing is with vectoradd() ...a built in GE function...

essentially it does the same thing your code does by taking the existing angle and directional_velocity and compars them with an another angle ( in this case the current angle to the target (foodblock) it then will add or subtract angles/velocities automatically for you,.. in increments

try this code here in the fish draw
Code: Select all
float FishAngle; //create a new var

FishAngle = direction(x, y, player.x, player.y); //find current angle to target

directional_velocity = 5;

vectoradd(&angle, &directional_velocity, FishAngle, .5);
//use current angle and velocity to set new angle using increments of x ...
//in this case.5... use higher numbers to home in faster..



from script reference
vectoradd: Adds vector2 (angle2, magnitude2) to vector1 (angle1, magnitude1) and returns the result in vector1 (angles in degrees).
void vectoradd(double *angle1, double *magnitude1, double angle2, double magnitude2).

and the tutorial here
http://game-editor.com/examples/vectoradd.zip
User avatar
feral
 
Posts: 308
Joined: Sun Mar 16, 2008 6:27 am
Score: 47 Give a positive score

Re: dynamic water example

Postby zygoth » Thu Jul 24, 2008 12:42 am

hmmm...it's definitely prettier, but I prefer my code where the fish adjust the same amount every time rather than a fraction of the difference. with yours the closer it gets to the right angle the slower it improves. I suppose you could use either one, really.
Nice water effect by the way.
Nova: 100% Vertigo/Mazeman: 100%
Visit my website to download them both! http://www.ketonegames.com
User avatar
zygoth
 
Posts: 140
Joined: Mon Jun 11, 2007 6:37 pm
Score: 5 Give a positive score


Return to Game Demos

Who is online

Users browsing this forum: No registered users and 1 guest

cron