Updates:

Fans are welcome!

The Guardian Legend remake

Started by teremochek, January 12, 2010, 06:14:47 AM

Previous topic - Next topic

UserK

Yes. Sort of. Still 2000+ LOC per file is scary.

teremochek

Quote from: UserK on October 15, 2011, 12:51:15 AM
Yes. Sort of. Still 2000+ LOC per file is scary.

Cause I have a high resolution of 1920x1200. It looks almost normal.
If the program in BlittsMaks for you hard, then write the code, as you know how. I then translate it into blittsmaks

UserK


teremochek

Quote from: UserK on October 16, 2011, 01:05:26 AM
What does that even mean???  :o

Write the logic of the monster. I'll rewrite it in BlittsMaks. (Do you know how to program?)
  Example:

time=time+1
if time>30 then time=0
if time<15 then x=x+1 ; y=y+4
if time>=15 then x=x-1 ; y=y+4

UserK

Yes.
What I was trying to say: if your files are 2000+ lines, just because of "objects" perhaps you should be looking into a way to make it more data-driven and less code-driven.
I'll try to draw what I think might be slowing you down massively.

Now, everyone has his style and if you can go along with that... that's ok.

teremochek

Ship.Y=start - ?  It's just a typo (mistake). It should look like this Ship.Y=ystart
xstart and ystart initial coordinates of the object when you call. Called like this:xstart=120 ; ystart=-16 ; TMeteoritCircle3.Create(File:String,xstart:int,ystart:int)

Magic numbers (enums?)
        Field X:Double  - Position the sprite axis X
        Field Y:Double 
        Field dx:Float  - dx=cos(angle) ; x=x+dx*speed      this formula, we obtain circular movements
        Field dy:Float
        Field angle:Float  If angle = 90 then the sprite is moving down
        Field speed:Float   The speed of the sprite   
        Field Image':TImage  If Image = 760. Then the sprite will look like a File Sprites/760.png
        Field bg_function:Int  . . . .
        Field Life:Float  - Hit points
        Field Time:Int
        Field Functions:Int
        Field order:Int  - Layer on that draw sprites. Order = 2 sprites are drawn on top of sprites with order = 1
        Field dmg:Float  - damage

It's time to sleep. . .

teremochek

Same code, use inheritance?
Common base func?

Sorry, but I'm not good at programming. Do not know what to say. The main loop)


'=========================================================== MAIN LOOP
#mainloop
Repeat
        Cls        ----------  Clear the graphics buffer.
        GCMemAlloced()   ---------- Clear the memory from the garbage   

        For oo:TGameObject=EachIn GameObjectList 
            If inv=0                     
               oo.UpdateState()  ' ----------  Here are the methods(UpdateState()) of all game objects.
               oo.Collide()            ' ----------  Here are the methods(Collide() ) of all game objects.
            Else
               If oo.order>=9   
                 oo.UpdateState()
                 oo.Collide()   
               EndIf
            EndIf
        Next;oo=Null;

      SortSprites() ' -------------- This function sorts objects by size "order." From smaller to larger
              SetScale(zoomX:Float, zoomY:Float); '--------------- increase the sprites

       For o:TGameObject=EachIn GameObjectList
            If inv=0
               o.DrawSelf()    ' ----------------- Here are the sprites are drawn
            Else
               If o.order>=9;o.DrawSelf() 
            EndIf   
       Next;o=Null

            textfunction() '--------- draw the text
            SetScale(zoomX:Float/5, zoomY:Float/5)

       For o:TGameObject=EachIn GameObjectList   
             If inv=0   
                o.DrawFigures()  '--------- draw the figures(for debugging)
             Else
               If o.order>=9  ; o.DrawFigures()
             EndIf 
       Next;o=Null

              '     --------------------- It is still important.
                '------------------------------------------------------ ===========================================>   skorost dwijeniya bg
            If inv=0 And end_fly=0 '---------------- izmenaetsya tolko ne w inventare
             If Global_editor=0
                If bg_speed:Float>bg_speed_change:Float
                  bg_speed:-0.01;If bg_speed:Float<bg_speed_change:Float Then bg_speed:Float=bg_speed_change:Float     
                Else
                  If bg_speed:Float<bg_speed_change:Float Then  bg_speed:+0.01;If bg_speed:Float>bg_speed_change:Float Then bg_speed:Float=bg_speed_change:Float '
                EndIf
             Else
                bg_speed:Float=bg_speed_change:Float; '--------------------- skorost 2 dwijeniya bg
             EndIf
            EndIf

If end_fly=1 And boss=0 ;TFlyEnd.Create(File:String,0,ystart:Int) ; end_fly=0


CallingButtons()  '---------Buttons (for debugging)
textfunction() '--------- draw the text
Flip(-1)  '--------- Show Sprites, Vertical sync =- 1
Until KeyDown(KEY_ESCAPE) Or AppTerminate()   ' ---------------------------------------------- go to Repeat
End

teremochek

Probably animation-driven?
Use animation sync function!


I like your idea of code optimization.But, Let's not touch my code.
I will file for you. (The_Guardian_Legend_BlitzMax_5.bmx)
Write it as you like!

teremochek

Perhaps TMeteoritCircle4 should extend TMeteoritBlue?
No. So do not want to compile blitzMax. (At least I do not know how)

UserK

The question is not what you're doing. Is how you're doing.
I am also working on a project. I must stay focused.

teremochek

Quote from: UserK on October 17, 2011, 10:55:17 AM
The question is not what you're doing. Is how you're doing.
I am also working on a project. I must stay focused.
I am glad that you know about programming.
If something is unclear or need help, I can help.
We can prevent the language barrier. Therefore, questions should be simple and clear.  :bluelander: :redlander:

teremochek

Global variables.

Global zoomX:Float = 2
Global zoomY:Float = 2
Global GameObjectList:TList=CreateList()
Global InventaryObjectList:TList=CreateList()
Global Global_editor:Byte=0
Global max_img:Int
Global current_img:Int=1
Global bg_loaded:Int
Global bg_saved:Int
Global bg_speed:Float=0
Global bg_speed_change:Float=0
Global end_fly:Byte=0
Global CreateObject:Int
Global LoadStroka:Int=0
Global X_Player:Float,Y_Player:Float
Global napr:Byte
Global weapon:Byte=3
Global weapon_power:Byte=1
Global weapon1_power:Byte=1
Global weapon2_power:Byte=0
Global weapon3_power:Byte=0
Global weapon4_power:Byte=0
Global weapon5_power:Byte=0
Global weapon6_power:Byte=0
Global weapon7_power:Byte=0
Global weapon8_power:Byte=0
Global weapon9_power:Byte=0
Global weapon10_power:Byte=0
Global weapon11_power:Byte=0
Global weapon12_power:Byte=0
Global weapon13_power:Byte=0
Global weapon14_power:Byte=0
Global weapon15_power:Byte=0
Global inv:Byte=0
Global use_chip:Int=0
Global max_chip:Int=50
Global chip:Int=50
Global score:Int
Global shot:Int
Global keys:Byte=6
Global attack:Byte=1
Global shield:Byte=1
Global shotspeed:Byte=2
Global EE:Byte=0
Global max_energy:Int=64
Global new_energy:Int=0
Global min_energy:Byte=0
Global energy:Int=max_energy
Global max_hp:Int
Global hp:Int   
Global ship_damage:Int=0
Global damage_time:Int=0
Global level_multiplier:Byte=1
Global level_X:Byte=11
Global level_Y:Byte=12
Global mode:Byte=0
Global X_bg:Float
Global Y_bg:Float
Global X_monster:Double
Global Y_monster:Double
Global Z_monster:Float
Global music:Byte
Global delay1:Int=0
Global text:Byte=0
Global boss:Byte=0
Global monster:Byte=0
Global corridor:Byte=0
Global Dirs:Byte=0
Global Map
Global MapArea:Int[]
Global MapLentgh:Int=0
Global MapDirectory:String=""
Global MapDirectory2:String=""
Global MapAreaWalkSave:Int[,]=New Int[16,576]

teremochek

That's been more than half a year, I stopped programming TGL remake.
And if we speak the truth, then this project is dead. Lastly I want to give a level editor.
Happy Birthday Guardic Gaiden !  :heart:

http://sourceforge.net/projects/tglbm/

UserK

That is very unfortunate. I must admit you have been very determined considering the source. Thank you for sharing, at least the data is there. Perhaps a day it will be useful.

RubyC42

My YouTube channel for gameplay videos [includes TGL: Secret gameplays!]

Are you a Text Role-player? We have a TGL-themed RP going on, feel free to join!