Ooops
October 28, 2021, 12:57:29

Author Topic: new with bliztmax  (Read 705 times)

Offline zelda64bit

  • Jr. Member
  • **
  • Posts: 54
new with bliztmax
« on: May 07, 2021, 18:14:55 »
Hello everybody.

I had wanted to learn bliztmax for a long time but since I couldn't find anything in Spanish I had to give it up for a while.

I recently found the page of bliztmax ng and thanks to the google translator I was able to learn something about bliztmax.

I am using version 1.50 because ng takes a long time to compile. Now I am looking for a tutorial that will teach me step by step how to create a game with several levels, but I can't find anything.

I have programmed some things with gamemaker and clickteam fusion but doing everything with code and without help is quite complicated.

I would like to do these kinds of games.

[/youtube]

Offline Skaven

  • Jr. Member
  • **
  • Posts: 25
Re: new with bliztmax
« Reply #1 on: May 07, 2021, 18:40:16 »
dont use blitzmax legacy/vanilla it is too old and dead
use blitzmax ng instead
only the first compile takes a long time
use framework to cutdown on compile time

Offline Midimaster

  • Sr. Member
  • ****
  • Posts: 364
    • Midimaster Music Education Software
Re: new with bliztmax
« Reply #2 on: May 08, 2021, 02:13:20 »
If you start with learning coding computer games it does not matter whether you use BlitzMax 1.50 or BlitzMax NG. There is no difference for beginners. And when you ever get the feeling that you need to upgrade, you will not get to much problems in transfering code to NG.

I still believe in BlitzMax as it is a "complete" computer language and not only a game SDK. So if you ever want to control your "smart home" from PC BlitzMax will be able to do it. you can write a "server" or a "chat-software" or a music editor with  recording.... You will never feel limitations with BlitzMax.

The game example you showed can be done with BlitzMax. But you will need to learn a lot of things like painting your sprites, inventing music and search sounds. The programming will be the smallest part oft it. Each effect can be broken down to a "dozend" of code lines. And you need a language which is able to handle "types" and "lists".

Be sure you will find in the forum a lot of friends, who will help you, when you ask. We all learned it by asking.
But at the beginning you should know, that a design like in the game you showed will need years of experience. So if you can be happy with a (at first) un-spectacular design you can start your game and it grows form month to month with your skills.


Code: [Select]
SuperStrict
Graphics 400,600

Global X#, Y#, LandY#

Repeat
Cls
Landscape
BattleShip
Fire
Flip 0
Until AppTerminate()


Function Landscape()
If LandY>-1 Then LandY=-100
For Local i%=0 To 6
SetColor 0,100,0
DrawRect 0,LandY+100*i,400,50
SetColor 0,105,0
DrawRect 0,LandY+50+100*i,400,50
Next
SetColor 55,55,55
DrawRect 150,0,100,600
LandY = LandY+0.05
End Function


Function Battleship()
  SetColor 0,0,111
DrawRect MouseX()-20,500,40,40
If MouseHit(1)
X=MouseX()
Y=480
EndIf
End Function


Function Fire()
SetColor 255,255,0
DrawRect X,Y,3,20
Y=Y-0.5
End Function
« Last Edit: May 08, 2021, 02:17:48 by Midimaster »
See my current project on PlayStore: 20Tracks-Audio-Player https://play.google.com/store/apps/details?id=midimaster.twentytrackd

Offline Derron

  • Hero Member
  • *****
  • Posts: 3675
Re: new with bliztmax
« Reply #3 on: May 08, 2021, 07:44:13 »
There is no difference for beginners.

NG requires you to write at least "Strict" (which gets rid of a lot of beginner mistakes already - like duplicate local variables, spelling errors in variables ...).
Also "vanilla" is x86 only ... might not run on Mac (if you are a Mac user with current Mac OS X).
Some bugfixes were no longer backported to vanilla (as I got too lazy and am no longer using vanilla).
Some modules are only available for "vanilla". But more and more modules are only updated or available at all for "NG".

NG offers SDL (better multi monitor support, touch input, ...) but this is not something the beginner needs when "prototyping" their ideas.
NG offers audio.mod/soloud.mod as basic audio backend - allowing for streamed audio and other things (might even interest beginners).
NG has updated enet.mod (think of IPv6)  but this is also not for beginners - so not overly important here.
...


For "trying out the language" NG is still the way to go:
- self contained (Windows: download, unzip, everything is contained, no need to worry about clashing of MinGW versions or so)
- "strict" (avoids many beginner pitfalls)


bye
Ron

Offline zelda64bit

  • Jr. Member
  • **
  • Posts: 54
Re: new with bliztmax
« Reply #4 on: May 08, 2021, 16:32:52 »
If you start with learning coding computer games it does not matter whether you use BlitzMax 1.50 or BlitzMax NG. There is no difference for beginners. And when you ever get the feeling that you need to upgrade, you will not get to much problems in transfering code to NG.

I still believe in BlitzMax as it is a "complete" computer language and not only a game SDK. So if you ever want to control your "smart home" from PC BlitzMax will be able to do it. you can write a "server" or a "chat-software" or a music editor with  recording.... You will never feel limitations with BlitzMax.

The game example you showed can be done with BlitzMax. But you will need to learn a lot of things like painting your sprites, inventing music and search sounds. The programming will be the smallest part oft it. Each effect can be broken down to a "dozend" of code lines. And you need a language which is able to handle "types" and "lists".

Be sure you will find in the forum a lot of friends, who will help you, when you ask. We all learned it by asking.
But at the beginning you should know, that a design like in the game you showed will need years of experience. So if you can be happy with a (at first) un-spectacular design you can start your game and it grows form month to month with your skills.


Code: [Select]
SuperStrict
Graphics 400,600

Global X#, Y#, LandY#

Repeat
Cls
Landscape
BattleShip
Fire
Flip 0
Until AppTerminate()


Function Landscape()
If LandY>-1 Then LandY=-100
For Local i%=0 To 6
SetColor 0,100,0
DrawRect 0,LandY+100*i,400,50
SetColor 0,105,0
DrawRect 0,LandY+50+100*i,400,50
Next
SetColor 55,55,55
DrawRect 150,0,100,600
LandY = LandY+0.05
End Function


Function Battleship()
  SetColor 0,0,111
DrawRect MouseX()-20,500,40,40
If MouseHit(1)
X=MouseX()
Y=480
EndIf
End Function


Function Fire()
SetColor 255,255,0
DrawRect X,Y,3,20
Y=Y-0.5
End Function

Thanks for the example. ;)

I would like to know how I could create two phases and when pressing a button go from phase 1 to 2. In gamemaker it is easy because with a single function you can go from one phase to another, but in bliztmax I don't really know how to do this.

Offline Midimaster

  • Sr. Member
  • ****
  • Posts: 364
    • Midimaster Music Education Software
Re: new with bliztmax
« Reply #5 on: May 09, 2021, 08:47:36 »
what do you means with "phases"? Levels?

Code: [Select]
Global Level:INT=0
Repeat
     Cls
     Select Level
          Case 0
               Menu
          Case 1
               GameA
          case 2
               GameB
     End Select
     Flip 1
Until AppTerminate()


Function Menu
     DrawText "menu level",100,100
    ' do what ever you want
     If MouseHit(1) then Level=1
End Function


Function GameA
     DrawText "game level A",100,100
    local Win%=0
    ' do what ever you want
     If MouseHit(1) then Win=1
     If Win=1 Then Level = Level+1   
End Function


Function GameB
     DrawText "game level B",100,100
    ' do what ever you want
     If MouseHit(1) then Level=0
End Function

There are different ways to create levels. The simples is to define a function for each level. This means a lot of writing work, but the logic keeps easy. Each function is like a "main loop" and does not know anything about the other levels. Of course all resources are loaded before Repeat/Until an are accessable from all levels.

If you want to load resources in the moment, when the level start you only have to create a second variable FirstTime, to check whether this is the first time you enter this level:

Code: [Select]
Global Monster:TImage
Global Level:INT=0
Repeat
     Cls
     Select Level
          Case 0
               GameA
          case 1
               GameB
     End Select
     Flip 1
Until AppTerminate()


Function GameA
     Global FirstTime:Int
     If FirstTime=0
          FirstTime=1
          Monster=LoadImage("monster.png")
     Endif
     DrawImage Monster, 100,100
End Function


Function GameA
     Global FirstTime:Int
     If FirstTime=0
          FirstTime=1
          Monster=LoadImage("angel.png")
     Endif
     DrawImage Monster, 100,100
End Function
See my current project on PlayStore: 20Tracks-Audio-Player https://play.google.com/store/apps/details?id=midimaster.twentytrackd

Offline zelda64bit

  • Jr. Member
  • **
  • Posts: 54
Re: new with bliztmax
« Reply #6 on: May 09, 2021, 14:19:39 »
what do you means with "phases"? Levels?

Code: [Select]
Global Level:INT=0
Repeat
     Cls
     Select Level
          Case 0
               Menu
          Case 1
               GameA
          case 2
               GameB
     End Select
     Flip 1
Until AppTerminate()


Function Menu
     DrawText "menu level",100,100
    ' do what ever you want
     If MouseHit(1) then Level=1
End Function


Function GameA
     DrawText "game level A",100,100
    local Win%=0
    ' do what ever you want
     If MouseHit(1) then Win=1
     If Win=1 Then Level = Level+1   
End Function


Function GameB
     DrawText "game level B",100,100
    ' do what ever you want
     If MouseHit(1) then Level=0
End Function

There are different ways to create levels. The simples is to define a function for each level. This means a lot of writing work, but the logic keeps easy. Each function is like a "main loop" and does not know anything about the other levels. Of course all resources are loaded before Repeat/Until an are accessable from all levels.

If you want to load resources in the moment, when the level start you only have to create a second variable FirstTime, to check whether this is the first time you enter this level:

Code: [Select]
Global Monster:TImage
Global Level:INT=0
Repeat
     Cls
     Select Level
          Case 0
               GameA
          case 1
               GameB
     End Select
     Flip 1
Until AppTerminate()


Function GameA
     Global FirstTime:Int
     If FirstTime=0
          FirstTime=1
          Monster=LoadImage("monster.png")
     Endif
     DrawImage Monster, 100,100
End Function


Function GameA
     Global FirstTime:Int
     If FirstTime=0
          FirstTime=1
          Monster=LoadImage("angel.png")
     Endif
     DrawImage Monster, 100,100
End Function

Yes, phases are levels and thanks for the examples. ;)
could be done only with classes instead of functions, it is easier for me.
What is the AppTerminate () function for.

Offline Pingus

  • Full Member
  • ***
  • Posts: 135
Re: new with bliztmax
« Reply #7 on: May 09, 2021, 16:07:07 »
Blitzmax vanilla is perfect for the beginning. NG is only required if you want to make your game working on Mac.
Vanilla compilation/building time is unbeatable.

That said, and althought it is always a good thing to learn new things, why give up with Gamemaker which also fit perfectly well for that kind of action game ?

Offline Midimaster

  • Sr. Member
  • ****
  • Posts: 364
    • Midimaster Music Education Software
Re: new with bliztmax
« Reply #8 on: May 09, 2021, 17:58:13 »
...
could be done only with classes instead of functions, it is easier for me.
What is the AppTerminate () function for.

"Classes" are called TYPE in BlitzMax. You use it if you need more instances of objects. f.e. enemies or actors like self moving game elements. I never used types for levels, bnut for the actors inside the level.

F.e. in my first example there is only one shot possible. Normally a gun fires shots with creating "shot objects" in a shot-list. Each shot "lives" as long as it reaches the screen border or  hits something.

The AppTerminate() is the check for "user clicked the X in the right top corner to close the window". 
See my current project on PlayStore: 20Tracks-Audio-Player https://play.google.com/store/apps/details?id=midimaster.twentytrackd

Offline zelda64bit

  • Jr. Member
  • **
  • Posts: 54
Re: new with bliztmax
« Reply #9 on: May 09, 2021, 20:15:27 »
...
could be done only with classes instead of functions, it is easier for me.
What is the AppTerminate () function for.

"Classes" are called TYPE in BlitzMax. You use it if you need more instances of objects. f.e. enemies or actors like self moving game elements. I never used types for levels, bnut for the actors inside the level.

F.e. in my first example there is only one shot possible. Normally a gun fires shots with creating "shot objects" in a shot-list. Each shot "lives" as long as it reaches the screen border or  hits something.

The AppTerminate() is the check for "user clicked the X in the right top corner to close the window".

Thanks for the help Midimaster. ;)

Offline zelda64bit

  • Jr. Member
  • **
  • Posts: 54
Re: new with bliztmax
« Reply #10 on: May 09, 2021, 20:18:44 »
Blitzmax vanilla is perfect for the beginning. NG is only required if you want to make your game working on Mac.
Vanilla compilation/building time is unbeatable.

That said, and althought it is always a good thing to learn new things, why give up with Gamemaker which also fit perfectly well for that kind of action game ?

I am not going to leave gamemaker, only that gamemaker is commercial and its language is limited, bliztmax is free and its language is more complete, and I want to learn more about programming. :)

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal