Removed

BlitzPlus Forums/BlitzPlus Programming/Removed

Caton(Posted 2014) [#1]
Post Removed


Matty(Posted 2014) [#2]
Its not that simple. For instance I doubt in c++ there is a direct translation of the graphics command or many of the high level commands.


Caton(Posted 2014) [#3]
can somebody help me with this?


Caton(Posted 2014) [#4]
can somebody tell me the blitz commands in c++?


GfK(Posted 2014) [#5]
You're generally going to have to wait a little more than four minutes before you get a reply.

That aside, I'm not even sure you understand the enormity of what you are asking. This is not a trivial task.


Caton(Posted 2014) [#6]
Change to the blitz code to C++! please.


Caton(Posted 2014) [#7]
what is rect blitz command in C++?


Yasha(Posted 2014) [#8]
That's the equivalent of asking "What is the Pardoner's Tale in Japanese?"

I hate to be this hard, but the question is so obviously beyond your ability that it's difficult for other people to even formulate an answer that you'd be likely to understand (other than the obvious "no"). It's painfully transparent to everybody that you don't know enough (any?) C++, or enough about graphics libraries, to get anywhere with this. Sorry.

If your goal is to learn, you need to start with something a lot more basic.


Leon Drake(Posted 2014) [#9]
you'd be better off porting this code to monkey and then building a GLFW target


xlsior(Posted 2014) [#10]
C++ doesn't include any of the more advanced animation, sound, etc. game creation commands, it's all 3rd party libraries... So there is no "standard" C++ anything from blitz can be converted into, without adding a bunch of non-standard components in the process.

And seriously, I think you're trying to bite of a lot more than you can chew at the moment... Rather than having everyone else create a game for you (why would they?!), it might be better if you learn the basics of what's actually -involved- in creating a game.


Who was John Galt?(Posted 2014) [#11]
Yup, start small or you will get nowhere.

Lesson 1: Indent that Blitz code so it's readable.


Hotshot2005(Posted 2014) [#12]
You got to Learn walk before you run!

I agree with John Galt :)

C++? It can be quite daunting at first and it does take time by learning own Hello world program then input program then make own Quiz program then Hangman program then tic tac toe program then you go on learn SFML(which is C++ library I think....correct me if i am wrong) where you can make graphics of blob on the screen or put sprite on screen and learn move round with input control(such arrows keys!)

IF I was you....Focus on Blitzbasic because it is easiest programming language there is, learn the basic and start small then build it up then you got somethings to show for it :)

Good Luck :)


Hotshot2005(Posted 2014) [#13]
This is small Basic 2D shooter and it isn't perfect but it just a start :)

; Name of the Game - HELLFIRE
; ------------------------------------------------
; (1) Add title screen and Game over screen too.
; (2) Level Select
; (3) Add Score
; (4) Add Hiscore
; ------------------------------------------------

;Game Version 1.0

Graphics 800, 600
SetBuffer BackBuffer()
Global fntArial
Global player_x=5
Global player_y=280
Global lifes
Global bullet_x, bullet_y
Global bullet_enabled
Global Title=False
Global Level$   = "Very Easy"
Global Levels
Global Score
Global Hi_Score =250
Global Font1
Global Font2
Global FirstX, LastX
Global FirstY, LastY


Font1=LoadFont("Arial",20,True,True,False)
Font2=LoadFont("Arial",120,True,True,False)

Score    =0
Levels   =1
Level$   = "Very Easy"

bullet_x = player_x
bullet_y = player_y
bullet_enabled = False

; The rock Type
Type Rock
    Field x,y
    Field destroyed
End Type

Title=False
endgame=False 

Repeat 

      Cls

      If Title=False
            If KeyHit( 1 )     
                endgame=True   
            EndIf              
         lifes = 100
         Intro()
      Else
            If KeyHit( 1 )     
                title=False    
            EndIf              
          Draw_Rock()
          Draw_Player()
          Draw_bullets()
      EndIf

      If Lifes<=0 Then Game_over() : Title=False

            count_rock=0                                                        
            For pointer_rock.rock=Each rock
                count_rock=count_rock+1
            Next
            disp_text$=" Rocks: "+count_rock+" "                               
            disp_text_width=StringWidth( disp_text )
            disp_text_height=StringHeight( disp_text )
            Color 0,0,0
            Rect GraphicsWidth()-disp_text_width,GraphicsHeight()-disp_text_height , disp_text_width,disp_text_height , True
            Color 128,192,255
            Text GraphicsWidth()-disp_text_width,GraphicsHeight()-disp_text_height , disp_text , False,False

      Flip

Until endgame 

FreeFont Font1
FreeFont Font2

End


Function Intro()

        player_x=5
        player_y=280
        Level$  = Level$

         For value = 0 To 255
             red   = 255 - value
             green = 225
             blue  = value
             Color red , green , blue

             ; Convert color position to vertical position
             relative = value * GraphicsHeight () / 255
             Rect 0 , lastheight , GraphicsWidth () , relative

             ; Remember previous vertical position
             lastheight = relative
         Next

         Color 0,0,255

         If KeyHit(205) Then Levels=Levels+1  ;;
         If KeyHit(203) Then Levels=Levels-1  ;;

         If Levels<1  Then Levels =1
         If Levels=>3 Then Levels =3

         SetFont Font2
         Text 375,115, "HELLFIRE",True,True

         SetFont Font1
         Text 375,250, "H i - S c o r e : "+Hi_Score,True
         Text 375,215, "Diffcult level:"+Level$,True
         Text 275,290, "Programming "
         Text 275,315, "by  G r a h a m "
         Text 175,450, "Move Arrow left to right to choose the Diffcult level",False,False
         Text 375,515, "Press Spacebar to Start",True,True

         Select Levels
                ; Very Easy
                Case 1
                     Level$="Very Easy"
                     FirstX =1     : LastX  =99000
                     FirstY =1     : LastY  =600

                ; Medium
                Case 2
                     Level$="Medium"
                     FirstX =1     : LastX  =6000
                     FirstY =1     : LastY  =600
                ; Very Hard
                Case 3
                     Level$="Very Hard"
                     FirstX =1500  : LastX  =3000
                     FirstY =5     : LastY  =580
         End Select

         If KeyDown(57)
            ;; delete each rock ;; A1a
            For i = 0 To 150
                r.rock = New Rock ; Create rocks
                r\x = Rand(FirstX,LastX)    ; The starting X
                r\y = Rand(FirstY,LastY)    ; The starting Y
                r\destroyed = False
            Next
            Title =True
         EndIf

;;         Flip
End Function

Function Draw_Rock()
         ; Set color for the rocks
         Color 255,80,10

         ;--------------Draw rocks----------------
         For r.rock = Each Rock
             Rect r\x,r\y,20,20
             r\x = r\x - 10
             If r\x < 0 Then ; If the rocks reaches the left
                r\x = Rand(580,950) ; of the screen, draw
                r\y = Rand(1,580) ; it at the left
         EndIf

             If RectsOverlap(player_x,player_y,30,15,r\x,r\y,20,20) Then
                lifes = lifes - 1
                If lifes =< 0 Then
                   player_x = -100
                   player_y = -100
                EndIf
             EndIf

             If RectsOverlap(bullet_x,bullet_y,5,2,r\x,r\y,20,20) Then
                Score=Score+1
                Delete r.rock
                bullet_enabled = False
                bullet_x = player_x + 5
                bullet_y = player_y + 10
             EndIf
         Next
End Function

Function Draw_Player()
        Color 10,150,10
        Rect player_x,player_y,30,15 ;      Draw player

        If KeyDown(208) Then player_y = player_y + 7 ; Go up
        If KeyDown(200) Then player_y = player_y - 7 ; Go down

        If player_y < 0 Then player_y = 0
        If player_y > 585 Then player_y = 585
End Function

Function Draw_bullets()
        If KeyHit(57) Then
           bullet_enabled = True
           bullet_x = player_x + 5
           bullet_y = player_y + 10
        EndIf

        If bullet_enabled = True Then
           bullet_x = bullet_x + 15
           Rect bullet_x,bullet_y,5,2
        EndIf

        SetFont Font1
        Color 255,255,255
        Text 300,5, "Lifes remaining:  " + lifes,False
        Text 100,5, "Score:  " + Score,False

        If Score>Hi_Score Then Hi_Score=Score
        Text 700,5, "Hi - Score: "+Hi_Score,True
End Function

Function Game_Over()
        Cls
        For value = 0 To 255
            red   = 255 - value
            green = 150
            blue  = value
            Color red , green , blue

            ; Convert color position to vertical position
            relative = value * GraphicsHeight () / 255
            Rect 0 , lastheight , GraphicsWidth () , relative

            ; Remember previous vertical position
            lastheight = relative
        Next
        Color 0,0,255
        SetFont Font2
        Text 375,315, "Game Over",True,True

        SetFont Font1
        Flip
        Delay 1000
        FlushKeys 
End Function