Author Topic: Pompom - Amoeba things[BB2D]  (Read 6848 times)

0 Members and 1 Guest are viewing this topic.

Offline mike_g

  • Amiga 1200
  • ****
  • Posts: 435
  • Karma: 34
    • View Profile
Pompom - Amoeba things[BB2D]
« on: January 06, 2007 »
A function I am working on that draws fuzzy things. It became a bit more complex than I initially expected so I might rewrite it useing types intead of arrays. I also plan on adding rotation and improving the speed. Anyway here it is:
Code: [Select]
;GLOBAL ARRAYS NEEDED
Dim fuzzer(10, 360), fuzzdir(10, 360)
;---------------------------------------------------------------------;
;***************************** DEMO **********************************;
;---------------------------------------------------------------------;
Graphics 1024, 768
SetBuffer BackBuffer()
SeedRnd MilliSecs()
Color 200, 50, 50
FUZZ_INIT(1, 100, 360)
FUZZ_INIT(2, 100, 360)
FUZZ_INIT(3, 100, 360)
FUZZ_INIT(4, 100, 360)
FUZZ_INIT(5, 100, 360)
While Not KeyHit(1)
Cls
FUZZY_CIRCLE(1, 300, 300, 100, 160, 50, 5, 1)
FUZZY_CIRCLE(2, 800, 500, 100, 360, 50, 5, 0)
FUZZY_CIRCLE(3, 550, 200, 50, 50, 40, 3, 0)
FUZZY_CIRCLE(4, 550, 200, 50, 50, 10, 1, 0)
FUZZY_CIRCLE(5, 400, 600, 100, 20, 10, 1, 0)
Flip
Wend
;---------------------------------------------------------------------;
;*************************** FUNCTIONS *******************************;
;---------------------------------------------------------------------;
Function FUZZ_INIT(number, intense, fuzz)
For i = 1 To fuzz
fuzzer(number, i) = Rand(0, intense)
Next
End Function
;------------------------------;
Function FUZZY_CIRCLE(number, cx, cy, rad, fuzz, intense, vibration, randy)
angstep# = Float(360) / Float(fuzz)

first_x = (cx - (rad +fuzzer(number, 1)) * Cos(deg#))
first_y = (cy - (rad +fuzzer(number, 1)) * Sin(deg#))
this_x = (cx - (rad +fuzzer(number, 1)) * Cos(deg#))
this_y = (cy - (rad +fuzzer(number, 1)) * Sin(deg#))
FUZZ_MOVE(number, 1, intense, vibration, randy)

LockBuffer
For i = 2 To fuzz
deg# = deg# + angstep#
last_x = this_x
last_y = this_y
FUZZ_MOVE(number, i, intense, vibration, randy)
this_x = (cx - (rad +fuzzer(number, i)) * Cos(deg#))
this_y = (cy - (rad +fuzzer(number, i)) * Sin(deg#))
Line last_x, last_y, this_x, this_y
Next
Line this_x, this_y, first_x, first_y
UnlockBuffer
End Function
;-------------------------------;
Function FUZZ_MOVE(number, i, intense, vibration, randy)
If fuzzdir(number, i) = 0
fuzzer(number, i) = fuzzer(number, i) + vibration +Rand(0, randy)
Else
fuzzer(number, i) = fuzzer(number, i) - vibration -Rand(0, randy)
EndIf

If fuzzer(number, i) >= intense
fuzzdir(number, i) = 1
Else If fuzzer(number, i) <= -intense
fuzzdir(number, i) =0
EndIf
End Function
« Last Edit: July 21, 2007 by Shockwave »

Offline Ghost^BHT

  • Clueless and Happy
  • ^GVY
  • Pentium
  • ******
  • Posts: 931
  • Karma: 49
  • BYTE ME!
    • View Profile
Re: Pompom - Amoeba things
« Reply #1 on: January 06, 2007 »
Very cool :) 

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Pompom - Amoeba things
« Reply #2 on: January 06, 2007 »
That is awesome dude, welldone indeed :)
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: Pompom - Amoeba things
« Reply #3 on: January 12, 2007 »
Thats pretty cool. It could be used for some kind of asteroid like enemies. Invasion of the fuzzies.

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
Re: Pompom - Amoeba things
« Reply #4 on: January 12, 2007 »

Mike_g

Any chance of an exe? We dont all have basic here.
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: Pompom - Amoeba things
« Reply #5 on: January 12, 2007 »
I have compiled it and put it online. You can download it from here:  amoebe

Offline mike_g

  • Amiga 1200
  • ****
  • Posts: 435
  • Karma: 34
    • View Profile
Re: Pompom - Amoeba things
« Reply #6 on: January 13, 2007 »
Hey zawran thanks for putting an exe up for me. I would have done so myself but havent been paying much attention to the Blitz forums the last couple of days. Anyway have some karma :) and yeah Im working on a little vector graphics game at the moment so i might put them in as evil wobbly blobs.

Offline benny!

  • Senior Member
  • DBF Aficionado
  • ********
  • Posts: 4384
  • Karma: 228
  • in this place forever!
    • View Profile
    • bennyschuetz.com - mycroBlog
Re: Pompom - Amoeba things
« Reply #7 on: January 13, 2007 »
Very nice. I liked the one at the left bottom best ! Thanks for supplying an exe as
I do not have Blitz either !!!
[ mycroBLOG - POUET :: whatever keeps us longing - for another breath of air - is getting rare ]

Challenge Trophies Won:

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: Pompom - Amoeba things
« Reply #8 on: January 13, 2007 »
Cool indeed mike_g. Thanks for the exe zawran.

Offline mike_g

  • Amiga 1200
  • ****
  • Posts: 435
  • Karma: 34
    • View Profile
Re: Pompom - Amoeba things
« Reply #9 on: January 14, 2007 »
Hey I'm glad you guys like it. I had a go at filling them using a (slightly crude) floodfill I made but it runs too slow if I use it each loop. The best way I can think of would be to start off with a fill and then switch only the pixels that need changing but I dont think i'm clever enough to work that one out :(

Maybe I'll do a line version, as opposed to circular. That would be a bit simpler to find out what pixels need changing.

Also in future I'll make exes for stuff. I dident originally do one for this cos I wasent finished with it, but then I got distracted and started doing something else.

Offline rdc

  • Pentium
  • *****
  • Posts: 1495
  • Karma: 140
  • Yes, it is me.
    • View Profile
    • Clark Productions
Re: Pompom - Amoeba things
« Reply #10 on: January 14, 2007 »
This article has some different flood-fill algos that may help. The quick-fill looks pretty good, although I haven't tried it myself.

Offline mike_g

  • Amiga 1200
  • ****
  • Posts: 435
  • Karma: 34
    • View Profile
Re: Pompom - Amoeba things
« Reply #11 on: January 14, 2007 »
Cool :) I bookmarked it for now since i'm a little drunk, but i'll be sure to go over it tomorrow or something.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Pompom - Amoeba things
« Reply #12 on: January 14, 2007 »
Very cool stuff indeed.
« Last Edit: January 14, 2007 by Clyde »
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won:

Offline taj

  • Bytes hurt
  • DBF Aficionado
  • ******
  • Posts: 4810
  • Karma: 189
  • Scene there, done that.
    • View Profile
Re: Pompom - Amoeba things
« Reply #13 on: January 16, 2007 »
Zawran: karma++ for supplying the exe!

Nice effect mike_g...I especially like the one down the bottom right. I wonder what it would look like if you changed colour depending on distance from centre of circle (eg things in the midle of the circle darker and things outside brighter???)

Challenge Trophies Won:

Offline mike_g

  • Amiga 1200
  • ****
  • Posts: 435
  • Karma: 34
    • View Profile
Re: Pompom - Amoeba things
« Reply #14 on: January 16, 2007 »
Quote from: taj
Nice effect mike_g...I especially like the one down the bottom right. I wonder what it would look like if you changed colour depending on distance from centre of circle (eg things in the midle of the circle darker and things outside brighter???)

Nice idea, I might do that :) but first i think I better rewrite the things using types, since the longer  leave it the more difficult it will become. At the moment I got a lot of other stuff to do for assignments I been leaving to the last minute that need to be in this week. Oh well maybe on the weekend.

Offline Clyde

  • A Little Fuzzy Wuzzy
  • DBF Aficionado
  • ******
  • Posts: 7271
  • Karma: 71
    • View Profile
Re: Pompom - Amoeba things
« Reply #15 on: January 16, 2007 »
Dude if you've got assignments to do, get those done first matey their more important.

Looking forward to seeing what you conjur up next :)

Cheers,
Clyde :)
Still Putting The IT Into Gravy
If Only I Knew Then What I Know Now.

Challenge Trophies Won: