Author Topic: Blobmonster  (Read 11001 times)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10816
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Blobmonster
« Reply #15 on: 2011-Feb-16 »
Nice. Here's my first idea:

Offline mentalthink

  • Prof. Inline
  • *****
  • Posts: 3375
  • Integrated Brain
    • View Profile
Re: Blobmonster
« Reply #16 on: 2011-Feb-18 »
Hi I try a simple modification, but I like too much, on Alphamode, I think is for polyvertor apply a velua about 0.7 or 0.8, well you have a cool effect like a gum, it´s like seem a viscosity fluid, the effect is really cool. Try it, in my opinion a Like more than the original, but it´s only my personal opinion.

Kind Regards,
Iván J.

Offline Hatonastick

  • Dr. Type
  • ****
  • Posts: 474
  • Amstrad CPC 6128
    • View Profile
Re: Blobmonster
« Reply #17 on: 2011-Mar-06 »
Kitty:  That Wii mini-game is a surprising amount of fun I always thought.

Albert:  That's seriously cool.  I love the little guy.  Reminds me a bit of some of the 'fish' you find in the deeper parts of the ocean with luminescent bits.
Mat. 5: 14 - 16

Android: Toshiba Thrive Tablet (3.2), Samsung Galaxy Tab 2 (4.1.2).
Netbook: Samsung N150+ Netbook (Win 7 32-bit + Ubuntu 11.10).
Desktop: Intel i5 Desktop with NVIDIA GeForce GTX 460 (Win 8.1 64-bit).

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Re: Blobmonster
« Reply #18 on: 2013-Apr-22 »
Change part of the the main code to this:
Code: (glbasic) [Select]
//create a blobMonster object
GLOBAL test AS blobMonster

test.Create(10, 10)

SETLOOPSUB "GLB_ON_LOOP" // - GLBasic V11 calls this at the END of "main"


//main loop
@SUB GLB_ON_LOOP: // this is called by the framework after the "main" init module
//update and draw the blobmonster
CLEARSCREEN
test.Update()
test.Draw()

SHOWSCREEN
ENDSUB

Compile to HTML5 and you get this:

https://dl.dropboxusercontent.com/u/292449/blobmonster.html

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Re: Blobmonster
« Reply #19 on: 2013-Apr-22 »
For a little HTML5 benchmark test modify tha main code again to this:

Code: (glbasic) [Select]
//create a blobMonster object
GLOBAL test[] AS blobMonster
CONSTANT numBlobs=10
REDIM test[numBlobs]

FOR i=0 TO numBlobs-1
test[i].Create(RND(300), RND(300), RND(1000))
NEXT

SETLOOPSUB "GLB_ON_LOOP" // - GLBasic V11 calls this at the END of "main"


//main loop
@SUB GLB_ON_LOOP: // this is called by the framework after the "main" init module
//update and draw the blobmonster
CLEARSCREEN
FOR i=0 TO numBlobs-1
test[i].Update()
test[i].Draw()
NEXT

SHOWSCREEN
ENDSUB

and blobMonster.Create to this:
Code: (glbasic) [Select]
//function that returns a new blob monster object. Blitzmax equivalent (kind of)
//of a constructor in C++/Java
FUNCTION Create AS blobMonster:inX#, inY#, inTime#
DIM self.tail[self.segments]
//starting point of the blob monster
self.x = inX
self.y = inY
self.time = inTime
//give the tail some coordinates, just make them the same as the main x and y for now
FOR i = 0 TO self.segments - 1
self.tail[i].x# = inX
self.tail[i].y# = inY
NEXT

RETURN self
ENDFUNCTION

And you got this:
https://dl.dropboxusercontent.com/u/292449/blobmonster30.html