Page 3 of 5 FirstFirst 12345 LastLast
Results 21 to 30 of 48

Thread: AirDogs 1942, a TBDI sample game

  1. #21

    Re: AirDogs 1942, a TBDI sample game

    Thanks for the explanation. I'll make the modifications soon.

  2. #22
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: AirDogs 1942, a TBDI sample game

    Perfect! All working fine now. Frame rate is very high.

    Mike, this is also a perfect example demonstrating how TBGL can also do 2D games.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #23
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: AirDogs 1942, a TBDI sample game

    Mike,

    for fun I set %MaxShots to 20 and get Runtime error at line 603. Line 603 is

    [code=thinbasic]
    for j = 1 to %maxShots
    [/code]

    but should be

    [code=thinbasic]
    for j = 1 to %MaxSmoke
    [/code]

    Also, because you are generating random numbers in your script, add a RANDOMIZE command at the beginning, so random generator will generate different sequences.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #24
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: AirDogs 1942, a TBDI sample game

    Mike,

    I've made a little variation adding specific and different turning angles and speed to every plane. See attached file with full source code.
    Mainly, tPlayer UDT is the following:

    [code=thinbasic] Type tPlayer
    X as double
    Y as double
    dir as double
    damage as double
    speed as double
    img as long
    vic as long
    TurnLeft as long
    TurnRight as long
    SpeedUp as long
    SpeedDown as long
    end type[/code]
    Than tPlayer setup inside SetupPlayers sub is something like:

    [code=thinbasic] Player(1).x = 90
    Player(1).y = yres/2
    Player(1).dir = 0
    Player(1).speed = 2
    Player(1).img = 1
    Player(1).TurnLeft = rnd(60, 200) '---Generate random turning angle
    Player(1).TurnRight = Player(1).TurnLeft '---Put the same as left but can be different
    Player(1).SpeedUp = rnd(3,7) '---Generate random max speed
    Player(1).SpeedDown = 1 '---Min speed is always 1

    Player(2).x = xres-90
    Player(2).y = yres/2
    Player(2).dir = 180
    Player(2).speed = 2
    Player(2).img = 2
    Player(2).TurnLeft = rnd(60, 200) '---Generate random turning angle
    Player(2).TurnRight = Player(2).TurnLeft '---Put the same as left but can be different
    Player(2).SpeedUp = rnd(3,7) '---Generate random max speed
    Player(2).SpeedDown = 1 '---Min speed is always 1[/code]

    New parameters are than used inside CheckKeyInput and CheckJoyInput subs.
    Consider that a possible evolution is to add some bonus (positive or negative) during game execution that will change turn angle and speed for every plane.

    Hope you will like.
    Ciao
    Eros

    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  5. #25

    Re: AirDogs 1942, a TBDI sample game

    Quote Originally Posted by ErosOlmi
    Mike,

    for fun I set %MaxShots to 20 and get Runtime error at line 603. Line 603 is

    [code=thinbasic]
    for j = 1 to %maxShots
    [/code]

    but should be

    [code=thinbasic]
    for j = 1 to %MaxSmoke
    [/code]

    Also, because you are generating random numbers in your script, add a RANDOMIZE command at the beginning, so random generator will generate different sequences.

    Ciao
    Eros
    Thanks Eros, I saw that yesterday too.

    And thanks for the mod, I plan on having several different planes to choose from for the player. With different values. But your mod could be a RANDOM plane. Good idea!

  6. #26
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: AirDogs 1942, a TBDI sample game

    Quote Originally Posted by Michael Hartlef
    Thanks Eros, I saw that yesterday too.

    And thanks for the mod, I plan on having several different planes to choose from for the player. With different values. But your mod could be a RANDOM plane. Good idea!
    Perfect Mike.

    Remeber to keep updated first post of this thread with your latest version of AirDogs 1942. When I will finish filling new thinBasic web site with initial minimum content, I would like to make a dedicated gaming area and AirDogs 1942 is a perfect choice to start with, if you like the idea.

    Ciao
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  7. #27

    Re: AirDogs 1942, a TBDI sample game

    Don't forget TopDown3D.

  8. #28
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Re: AirDogs 1942, a TBDI sample game

    I cant get it to run it complains about "%TBGL_Tex_ANISO" have i missed a TBGL update?

    Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
    Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
    Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
    Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370

  9. #29
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: AirDogs 1942, a TBDI sample game

    Abraxas,

    yes you did
    You can wait till next thinBASIC preview release ( I think quite soon ) or grab it here.
    It features mentioned anisotropic filtering and color masking for BMPs; more mini-patch than real new version.


    Bye,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  10. #30
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: AirDogs 1942, a TBDI sample game

    Quote Originally Posted by Michael Hartlef
    Don't forget TopDown3D.
    Of course, how can I forget all the Bonus Pack examples all of you have created.
    Ideas for the web are a lot, time a little less
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

Page 3 of 5 FirstFirst 12345 LastLast

Similar Threads

  1. GPF with AirDogs and TB 1.6.0.4
    By Michael Hartlef in forum thinBasic General
    Replies: 23
    Last Post: 21-04-2008, 21:48

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •