Author Topic: BlitzMax : Bob[BMAX]  (Read 4435 times)

0 Members and 1 Guest are viewing this topic.

Offline Dad1916

  • Atari ST
  • ***
  • Posts: 112
  • Karma: 3
    • View Profile
BlitzMax : Bob[BMAX]
« on: July 12, 2006 »
A simple bob effect. Sphere.png is attached.  O0


Code: [Select]
Graphics 800,600,0
 Local bobImage:TImage = LoadImage( "sphere.png" ) ' load the image we use for the bobs
MidHandleImage bobImage ' set the handle to the center

Local i:Int, bobXadd:Int, bobYadd:Int, bobUpdate

Local bobx[64], boby[64] ' setup placeholders for x and y position for the bobs
For i = 0 To 63
bobx( i ) = i * 4 Mod 360 ' space the positions out a little
boby( i ) = i * 3 Mod 360 ' using Mod to keep the numbers between 0 and 360
Next

bobXadd = 1 ' this is the values we add to move the bobs
bobYadd = 2 ' change these For different patterns

While Not KeyHit(1)

Cls

For i = 0 To 63
DrawImage bobImage, 400 + Sin( bobx[i] ) * 304, 240 + Sin( boby[i] ) * 224 ' draw the bobs onto the screen
Next

If MilliSecs() > bobsUpdate + 15 Then ' here we find the next position of the bobs
bobsUpdate = MilliSecs()
For i = 0 To 63
bobx[i] = bobx[i] + bobXadd Mod 360
boby[i] = boby[i] + bobYadd Mod 360
Next
End If

Flip

Wend
End
« Last Edit: July 21, 2007 by Shockwave »

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: BlitzMax : Bob
« Reply #1 on: July 12, 2006 »
Would have been nice if you had mentioned that this code and gfx was taken directly off the tutorial page on my website without any changes.

[edit] now that I have had time to thing about it, its alright since I will be posting all of my tutorials sometime this coming weekend, if SW think that they would be of any use in the blitz section. This way everyone can benefit from them, and it will be clear where they came from. I will be closing down my own forum this weekend as well, and redo my website, and replace my tutorials with a link to this forum because people are much better helped here since I don't have too much time currently and there are a lot of good people here to help out.
« Last Edit: July 12, 2006 by zawran »

Offline Dad1916

  • Atari ST
  • ***
  • Posts: 112
  • Karma: 3
    • View Profile
Re: BlitzMax : Bob
« Reply #2 on: July 13, 2006 »
Zarran,
Looking forward to the rest of your code appearing here :)

Offline Shockwave

  • good/evil
  • Founder Member
  • DBF Aficionado
  • ********
  • Posts: 17414
  • Karma: 498
  • evil/good
    • View Profile
    • My Homepage
Re: BlitzMax : Bob
« Reply #3 on: July 13, 2006 »
Thanks muchly Zawran :)
Good luck with the new site, though to be perfectly honest I like the one you have at the moment!
Shockwave ^ Codigos
Challenge Trophies Won:

Offline zawran

  • Sponsor
  • Pentium
  • *******
  • Posts: 909
  • Karma: 67
    • View Profile
Re: BlitzMax : Bob
« Reply #4 on: July 13, 2006 »
Its not going to change much lookwise, I think, I am just going to cut some stuff away.