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.

Code Snippets / Go Fish! (DBPro)

Author
Message
Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 28th Apr 2003 04:44
I was trying out some very, very basic AI tricks with sprites, and I came up with something that reminds me of how fish behave

Move the mouse around (the fish will follow) and make these fish swim towards the moving circle.
Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.
Whisper Wind
21
Years of Service
User Offline
Joined: 5th Apr 2003
Location:
Posted: 28th Apr 2003 04:57
Thats really cool nice job.
Rollit
20
Years of Service
User Offline
Joined: 26th Apr 2003
Location:
Posted: 28th Apr 2003 17:56
COOL!
nice output

Easily Confused
21
Years of Service
User Offline
Joined: 22nd Oct 2002
Location: U.K. Earth. (turn right at Venus)
Posted: 28th Apr 2003 21:31
Glad you like it

There is one problem with it however, it's very processor intensive and that problem lies with CheckSprToSpr() (which should be named CheckFishToFish(), oh well).

For each updating fish, it checks the distances to all the others, and tries to keep some distance away, so when the constant MAXSPR is set to 50, that's 50 x 49 checks (2450). Set MAXSPR to 100 and there should be a noticable slowdown (9900 checks), on my system it just about makes 30 fps in fullscreen exclusive mode.

Programming anything is an art, and you can't rush art.
Unless your name is Bob Ross, then you can do it in thirty minutes.

Login to post a reply

Server time is: 2024-04-20 15:50:57
Your offset time is: 2024-04-20 15:50:57