Hello Guest, please login or register.
Did you miss your activation email?
Login with username, password and session length.

Pages: [1]   Go Down

Author Topic: Blitzmax discussion thread  (Read 2481 times)

0 Members and 1 Guest are viewing this topic.

Mamoruanime

@Mamoruanime
Blitzmax discussion thread
« on: July 24, 2009, 04:06:41 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
I basically wanna see who all uses Blitzmax, and try to get some form of a following going on ZFGC. I'm still learning it myself, and I've noticed what made GM so easy to learn was the community gathering around to help one another. I think it'd be great to get that kind of dynamic going for Blitz.

So anyway, if anyone uses blitz, spill teh beanz
Logged
Re: Blitzmax discussion thread
« Reply #1 on: July 24, 2009, 04:37:19 am »
  • *
  • Reputation: +2/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1767
I've also started messing around with it myself. So far I'm just trying to turn one of the MaxGUI samples into a decently functional web browser instead of just a search engine. But yeah, great idea Mammo. I'd also appreciate this.
Logged
  • https://colbydude.com

Mamoruanime

@Mamoruanime
Re: Blitzmax discussion thread
« Reply #2 on: July 24, 2009, 05:04:33 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
I think it would definitely help people out for learning...

I think I may make a small Frogger game and post the source, then further discuss optimization from there, and other approaches to achieving the same thing. Kind of try to better the coding methodologies and such. That's something I've been lacking with other languages for a while :x
Logged
Re: Blitzmax discussion thread
« Reply #3 on: July 24, 2009, 05:11:43 am »
  • *
  • Reputation: +8/-0
  • Offline Offline
  • Gender: Male
  • Posts: 6604
All the hubbub about it makes it sound appealing and something to try out, but does it cost monies?
Logged

Mamoruanime

@Mamoruanime
Re: Blitzmax discussion thread
« Reply #4 on: July 24, 2009, 05:13:14 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
It's like $80 or something, but the way I see it---- when you buy it, you're paying for the synchronization and membership with their forum, since the application itself is very transferable <_<... There's no licensing whatsoever in it.
Logged

Xiphirx

wat
Re: Blitzmax discussion thread
« Reply #5 on: July 24, 2009, 06:18:55 am »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
I use 1.28

I made a few applications with it

I plan on making a map editor with it

I need MaxGUI

I has no monies

sad.gif
Logged
  • For The Swarm

Mamoruanime

@Mamoruanime
Re: Blitzmax discussion thread
« Reply #6 on: July 24, 2009, 07:05:03 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
Well; I started working on frogger... lol Image attached

Also heres sauce so far. I'm probably doing it all horribly wrong so please feel free to scold me. Well anyone except fini.

Code: [Select]
'Main Blitz Frogger '
'Handles main loop. '
'2009 Mamoruanime '

'Pre-loop setup-----------
Strict
HideMouse
Graphics 224,256,0
SetViewport(0,0,224,256)
AppTitle = "Blitz Frogger"

'-------------------------

'Includes-----------------
Include "tMap.bmx"
'-------------------------

'Main Loop----------------
While Not KeyDown(KEY_ESCAPE)
RenderMap(0)

Flip;Cls
Wend
'-------------------------

Code: [Select]
'tMap Blitz Frogger '
'Handles map rendering. '
'2009 Mamoruanime '

Incbin "tiles.png"

Function RenderMap(tileflags:Int)
'Local Variables.
Local imgTiles:timage = LoadAnimImage("tiles.png",16,16,0,16,-1)
Local tilemap:String = "000000000000001271271271271256856856856856000000000000000000000000000000000000000000000000000000000000000000000033333333333333000000000000000000000000000000000000000000000000000000000000000000000033333333333333"
Local tilepos:Int = 1 'Position on tilemap var. Indicates which tile to place.
Local tileatpos:Int = 0 'Current integer on the tilemap.
Local xpos:Int = 0 'X Position that resets every 14 tile placements.
Local ypos:Int = 0 'Y Position of our placement.

'Begin by drawing the two main backdrop colors (blue water, black pavement).
SetColor(0,0,71) 'Blue water top
DrawRect(0,0,224,128)
SetColor(0,0,0) 'Black Pavement
DrawRect(0,128,224,128)
SetColor(255,255,255) 'Default Color
'Start rendering the tilestream on top of the color rectangles.
While tilepos <> (Len(tilemap)+1)

tileatpos = Int(Mid(tilemap,tilepos,1))

If tileatpos <> 0
DrawImage(imgTiles,(xpos*16),(ypos*16), (tileatpos - 1))
EndIf

If xpos < 13
xpos:+ 1
Else
xpos = 0
ypos:+ 1
EndIf

tilepos:+ 1
Wend

EndFunction

Function Mode7Emulation()
'todo: Use GrabImage() to make an image out of the drawn background, and then
'transform it further using other functions to give a sense of depth.
EndFunction

Edit: Fixed transparency. <_<
« Last Edit: July 24, 2009, 07:17:31 am by Mamoruanime »
Logged
Re: Blitzmax discussion thread
« Reply #7 on: July 24, 2009, 01:12:46 pm »
  • Fight the Power
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 1245
Mammooo I think you should hold this and post it on the new boards. Just my opinion.
Just another reason to make more people want to come over in my opinion.

I'd also definetely check out the code when it's finished.

Just one question though,

What exactly do you mean by Frogger?
Logged

Currently Listening to: Mos Def - Summertime

Mamoruanime

@Mamoruanime
Re: Blitzmax discussion thread
« Reply #8 on: July 24, 2009, 01:18:06 pm »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
Nah; I'm not gunna prevent activity just to perpetuate something I don't necessarily support :P I'd rather work on what we have here, since no matter what happens, we always have this as a fallback ;p

Anyway------------------->

lol I'm making a quick frogger game to familiarize myself with Blitz a bit more. Most people do Hello World apps, but I do frogger :P

Source has been updated considerably-

Code: [Select]
'Main Blitz Frogger '
'Handles main loop. '
'2009 Mamoruanime '

'Pre-loop setup-----------
Strict
HideMouse
Graphics 224,256,0
SetViewport(0,0,224,256)
AppTitle = "Blitz Frogger"
'-------------------------

'Includes-----------------
Include "tIntro.bmx" 'Intro Routines
Include "tMap.bmx" 'Map Drawing Routines
Include "tText.bmx" 'Font stuff
Include "tMisc.bmx" 'Misc functions
'-------------------------

'Intro Loop---------------
While Not KeyDown(KEY_ENTER)
While CountList(introfroglist) < 7
CreateIntroFrog((CountList(introfroglist) + 1))
DebugLog String(CountList(introfroglist))
Wend

DrawBackColors()
UpdateIntroFrogs()
DrawSpriteText("1-Up",32,0,255,255,255)
DrawSpriteText("HI-SCORE",80,0,255,255,255)
GetFPS()
Flip;Cls
Wend
'-------------------------

'Main Loop----------------
While Not KeyDown(KEY_ESCAPE)
RenderMap(-1)

GetFPS()
Flip;Cls
Wend
'-------------------------

Code: [Select]
'tMap Blitz Frogger '
'Handles map rendering. '
'2009 Mamoruanime '

Incbin "tiles.png"

Function DrawBackColors()
SetColor(0,0,71) 'Blue water top
DrawRect(0,0,224,128)
SetColor(0,0,0) 'Black Pavement
DrawRect(0,128,224,128)
EndFunction

Function RenderMap(tileflags:Int)
'Local Variables.
Local imgTiles:timage = LoadAnimImage("tiles.png",16,16,0,16,tileflags)
Local tilemap:String = "000000000000001271271271271256856856856856000000000000000000000000000000000000000000000000000000000000000000000033333333333333000000000000000000000000000000000000000000000000000000000000000000000033333333333333"
Local tilepos:Int = 1 'Position on tilemap var. Indicates which tile to place.
Local tileatpos:Int = 0 'Current integer on the tilemap.
Local xpos:Int = 0 'X Position that resets every 14 tile placements.
Local ypos:Int = 0 'Y Position of our placement.

'Begin by drawing the two main backdrop colors (blue water, black pavement).
DrawBackColors()
SetColor(255,255,255) 'Default Color
SetMaskColor(255,0,255) 'Mask Color

'Start rendering the tilestream on top of the color rectangles.
While tilepos <> (Len(tilemap)+1)
tileatpos = Int(Mid(tilemap,tilepos,1))
If tileatpos <> 0
DrawImage(imgTiles,(xpos*16),(ypos*16), (tileatpos - 1))
EndIf
If xpos < 13 'Keep adding to your X position, then place the tile.
xpos:+ 1
Else 'Once you reach your final X position, go down 1 Y position, then back to 0 X.
xpos = 0
ypos:+ 1
EndIf
tilepos:+ 1 'Move forward on your tilemap string.
Wend

EndFunction

Function Mode7Emulation()
'todo: Use GrabImage() to make an image out of the drawn background, and then
'transform it further using other functions to give a sense of depth.
EndFunction

Code: [Select]
'tIntro Blitz Frogger '
'Houses intro routines '
'2009 Mamoruanime '
Global introfroglist:TList = CreateList()
Incbin "introtiles.png"

'Function to create your intro frogs.

Function CreateIntroFrog(index:Int)
Local frog:tIntroFrog
frog = New tIntroFrog
frog.index = index
frog.count = (index * frog.duration)

Select index
Case 1
frog.titleletter = 0
Case 2
frog.titleletter = 1
Case 3
frog.titleletter = 2
Case 4
frog.titleletter = 3
Case 5
frog.titleletter = 3
Case 6
frog.titleletter = 4
Case 7
frog.titleletter = 1
EndSelect

ListAddLast(introfroglist,frog)
EndFunction

Function UpdateIntroFrogs()

For Local frog:tIntroFrog = EachIn introfroglist
frog.Update()
Next

EndFunction

'Intro frog object.

Type tIntroFrog
Field duration:Int = 32 'Milliseconds until change.
Field count:Int 'Count until change.
Field index:Int 'What order was this created?
Field titleletter:Int 'Letter this turns into.
Field titlesprite:timage = LoadAnimImage("introtiles.png",16,16,0,16,-1)

Method Update()
If count > 0
count:- 1
EndIf
Draw()
EndMethod

Method Draw() 'Draw the logo
If count > 0
SetColor(255,255,255)
DrawImage(titlesprite,(8 + (index * 24)),52,5) 'Draw the default frog image.
Else
SetColor(255,255,255)
DrawImage(titlesprite,(8 + (index * 24)),52,titleletter) 'Now draw the letter.
EndIf

EndMethod

EndType

Code: [Select]
'tText Blitz Frogger '
'Routines for the font '
'2009 Mamoruanime '

Incbin "font.png"

Function DrawSpriteText(Str:String,x:Int,y:Int, colorr:Int, colorg:Int, colorb:Int) 'This is simply a replacement for the DrawText function.
Local strpos:Int = 0
Local stratpos:String
Local spacingx:Int = 8
Local realstr:String = Upper(Str)
Local fontspr:timage = LoadAnimImage("font.png",8,8,0,37,-1)

While strpos <= Len(Str)
stratpos = Upper(Mid(str,strpos,1))
SetColor(255,255,255)
If stratpos <> " " And stratpos <> "" And stratpos <> "-"
If stratpos <> "0" And stratpos <> "1" And stratpos <> "2" And stratpos <> "3" And stratpos <> "4" And stratpos <> "5" And stratpos <> "6" And stratpos <> "7" And stratpos <> "8" And stratpos <> "9"
DrawImage(fontspr,(x+(8*strpos)) - 8,y,(Asc(stratpos)-55))
Else
DrawImage(fontspr,(x+(8*strpos)) - 8,y,(Asc(stratpos)-48))
EndIf
Else If stratpos = "-"
DrawImage(fontspr,(x+(8*strpos)) - 8,y,36)
EndIf
strpos:+ 1
Wend

EndFunction

Code: [Select]
'tMisc Blitz Frogger '
'Misc functions. '
'2009 Mamoruanime '

Global ticks:Int
Global ticksbeforeswitch:Int
Global endtime:Int

Function GetFPS()

If MilliSecs() < endtime
ticks:+1
Else
ticksbeforeswitch = ticks
endtime = MilliSecs() + 1000
ticks = 0
EndIf

DrawSpriteText("FPS "+String(ticksbeforeswitch) ,0,248,255,255,255)

EndFunction

And the result is this:


Logged

Mamoruanime

@Mamoruanime
Re: Blitzmax discussion thread
« Reply #9 on: July 25, 2009, 08:49:15 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
Heres some random progress on frogger just to show how I'm doing this. I'm probably horribly off on my methodologies, so someone please step in and correct me :x but the idea is to get some discussion going on how to do this properly lol

Run the main.debug file
Logged
Re: Blitzmax discussion thread
« Reply #10 on: July 25, 2009, 04:54:16 pm »
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 448
I use Blitz3D. Well I haven't for a while but will be picking it up again shortly, after I work on my modeling skills. A group around here to consult with when you have problems would be nice, instead of having to bother Infini :P
Logged

Mamoruanime

@Mamoruanime
Re: Blitzmax discussion thread
« Reply #11 on: July 26, 2009, 04:35:35 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
I agree lol although I did bother him a bit today on something :P

I was thinking the SetMaskColor(r:int,g:int,b:int) function worked the same as things like SetColor(r:int,g:int,b:int) or SetRotation(rotation:int), where you call them before your drawing, but your SetMaskColor function is used prior to loading the image entirely, as apposed to before you actually use your image.

I wish someone would write an appropriate manual for blitz with examples and the like. Sadly that's something it's greatly lacking.
Logged

Xiphirx

wat
Re: Blitzmax discussion thread
« Reply #12 on: July 26, 2009, 10:04:40 pm »
  • Xiphirx
  • *
  • Reputation: +0/-0
  • Offline Offline
  • Gender: Male
  • Posts: 3007
I wish someone would write an appropriate manual for blitz with examples and the like. Sadly that's something it's greatly lacking.

YES.


I completely agree, I can never find any examples for the things I want to do, and I end up giving up or bothering Infini.
Logged
  • For The Swarm

Mamoruanime

@Mamoruanime
Re: Blitzmax discussion thread
« Reply #13 on: July 31, 2009, 09:40:05 am »
  • ^Not actually me.
  • *
  • Reputation: +9/-0
  • Offline Offline
  • Gender: Male
  • Posts: 9786
I've gotten a bit further in Frogger, but meh. I've done everything I needed to do in it :P I've...

1) Created a player object
2) Created a tilemap and routines to render it
3) Created basic collision detection

and I'm good for now XD
Logged
Pages: [1]   Go Up

 


Contact Us | Legal | Advertise Here
2013 © ZFGC, All Rights Reserved



Page created in 0.032 seconds with 63 queries.

anything