Page 1 of 5 123 ... LastLast
Results 1 to 10 of 48

Thread: tankwars kent sarikaya - kryton9

  1. #1
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    tankwars kent sarikaya - kryton9

    TankWars version 3.1
    Adjusted the Red and Orange and added a few new colors. Think of Blue as night mode

    Thanks to Petr for all his help and for Eros for giving us the fixes and additional requests for thinBasic.

    The splash screen has the latest keyboard and gamepad control help.

    This version brings a fun ai. The enemy do their patrols until you are in firing range. Then they turn and shot, if you go out of range they will go back to their patrol.
    It is fun to tease the tanks this way to see them react. You can also hang at the edge of the range, let them fire and pull back, watch their shot blow up short, what a great feeling.

    The game is set for medium difficulty, after a few games go for hardest and try to get a perfect game, that is take out all tanks with no hits on yours.
    Good luck!!

    Updated 2013: If version 3.1 gives an error then please download and use the fixed 3.2 version.
    3.2 Version for thinBasic 1.8.9.0
    Attached Files Attached Files
    Last edited by kryton9; 26-09-2013 at 03:56.

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

    Re: tank wars - a no media game

    ABSOLUTELY fantastic kent
    A little more AI for the tanks and we can start ... selling games
    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. #3

    Re: tank wars - a no media game

    Wow, I wasn't expecting that.

    You should upload some screenshots, I'm sure a lot more people would download the game if they could see how good it is.
    Operating System: Windows 10 Home 64-bit
    CPU: Intel Celeron N4000 CPU @ 1.10GHz
    Memory: 4.00GB RAM
    Graphics: Intel UHD Graphics 600

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

    Re: tank wars - a no media game

    Quote Originally Posted by Kent Sarikaya
    Eros, I need a recap on passing udt's as parameters. I tried but failed in this version. More later, but you guys get the idea of what is coming at least with this.
    Kent,

    yes, there are some limitations on this area. For example it is still not possible to pass an UDT if it is an element of an array of UDT. Thanks for recalling this to me. I will work on this.

    But you can pass a single UDT like the following example:
    [code=thinbasic]
    '---Define UDTs
    type txyz
    x as double
    y as double
    z as double
    end type

    type tplayer
    id as string * 6
    pos as txyz '--- position
    rot as txyz '--- rotation
    trg as txyz '--- target
    dist as double '--- distance from player
    near as long '--- id of nearest tank
    move as double '--- move amount
    turn as double '--- turn amount
    range as double '--- range of fire
    alive as long '--- alive or exists
    time as double '--- time alive or other time stuff
    name as string * 12
    end type

    '---Create some variables of that UDT
    dim MyNewPlayer_1 as tPlayer
    dim MyNewPlayer_2 as tPlayer

    '---Pass your UDT to a general purpose init function
    '---UDT passed as param are ALWAYS passed BYREF. It means a pointer to the
    '---original UDT is passed. Changes done inside the sub/function are in reality
    '---effecting the outside UDT
    initplayer(MyNewPlayer_1, "AAA")
    initplayer(MyNewPlayer_2, "BBB")

    msgbox 0, _
    "Player 1 ID is " & MyNewPlayer_1.id & $crlf & _
    "Player 2 ID is " & MyNewPlayer_2.id & $crlf & _
    ""

    '---Init a player
    sub initplayer(APlayerToBeInit as tPlayer, PlayerID as string)

    APlayerToBeInit.id = PlayerID
    APlayerToBeInit.pos.x = 0
    APlayerToBeInit.pos.y = RNDF(3, 3.25)
    APlayerToBeInit.pos.z = 0
    APlayerToBeInit.rot.x = 0
    APlayerToBeInit.rot.y = 0
    APlayerToBeInit.rot.z = 0
    APlayerToBeInit.trg.x = 0
    APlayerToBeInit.trg.y = 0
    APlayerToBeInit.trg.z = -1000
    APlayerToBeInit.move = 0.1
    APlayerToBeInit.turn = 0.5
    APlayerToBeInit.range = rndf(10, 100)

    end sub
    [/code]
    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. #5
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: tank wars - a no media game

    Thanks for the kind words guys, I was all excited yesterday about it and hoped to have it further along, but I hit a big wall today.
    Your nice words are encouragement to keep working on it as a team now.

    I wanted to share it and get input so that before it gets too complicated we can put in all the parts. Like the event manager,
    and Charles's stuff, not sure which

    I don't want to put screenshots yet as it is still not where I want it. It is more a demo to recruit you guys to join in.

    I have lots of ideas for it, but it will get complicated and it needs to be well organized and get the above mentioned elements in place.
    Thanks again for taking a look and kind words!!
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  6. #6
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: tank wars - a no media game

    Eros I logged onto post this example that doesn't work and see you replied back.

    I will post it anyways. This does not work, would be nice to be able to do something like this in the future
    [code=thinbasic]'---+------------------------------------------------------+
    '---| |
    '---| warning: |
    '---| |
    '---| this crashes the computer |
    '---| |
    '---+------------------------------------------------------+

    uses "console"

    type txyz
    x as double
    y as double
    z as double
    end type

    type tplayer
    pos as txyz
    rot as txyz
    end type

    dim p,e as tplayer

    p.pos.x = 100
    p.pos.y = 0
    p.pos.z = 100

    e.pos.x = 200
    e.pos.y = 0
    e.pos.z = 200

    print "distance between player p and enemy e is : "+format$(distance( p.pos , e.pos ),"0.00")

    console_waitkey

    function distance( a as txyz, b as txyz)
    local c as txyz
    c.x = a.x - b.x
    c.y = a.y - b.y
    c.z = a.z - b.z
    function = sqr( c.x * c.x , c.y * c.y , c.z * c.z )
    end function[/code]
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

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

    Re: tank wars - a no media game

    Kent,

    this is so professionally done retro, perfect-awesome-fantastic!
    I could not believe my eyes, very cool!

    Regarding the task you want to achieve ... pointers are programmers best friend :
    [code=thinbasic]

    uses "console"

    type txyz
    x as double
    y as double
    z as double
    end type

    type tplayer
    pos as txyz
    rot as txyz
    end type

    dim p,e as tplayer

    p.pos.x = 100
    p.pos.y = 0
    p.pos.z = 100

    e.pos.x = 200
    e.pos.y = 0
    e.pos.z = 200



    print ("distance between player p and enemy e is : "+format$(distance( varptr(p.pos) , varptr(e.pos)) ,"0.00"))

    console_waitkey

    function distance( ap as dword, bp as dword) as double
    local a as txyz at ap
    local b as txyz at bp
    local c as txyz

    c.x = a.x - b.x
    c.y = a.y - b.y
    c.z = a.z - b.z
    function = sqr( c.x * c.x + c.y * c.y + c.z * c.z )
    end function
    [/code]

    Now please excuse me, I have tanks to blow up

    BIG thanks,
    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

  8. #8
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    Re: Kent Sarikaya - kryton9

    Petr, I split your version off into its own sticky and will sticky any others also as they are made.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  9. #9
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    version 1.3, temporary sound

    Just put out a new update, added temporary sound for now. The latest version in is in the first post in this thread.
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

  10. #10
    thinBasic MVPs kryton9's Avatar
    Join Date
    Nov 2006
    Location
    Naples, Florida & Duluth, Georgia
    Age
    67
    Posts
    3,869
    Rep Power
    404

    version 1.4 updated radar

    The Radar now has 3 levels of color indication.
    Darkest Green tanks still alive
    Medium Green the nearest tank
    Bright Green the nearest tank is in range
    Acer Notebook: Win 10 Home 64 Bit, Core i7-4702MQ @ 2.2Ghz, 12 GB RAM, nVidia GTX 760M and Intel HD 4600
    Raspberry Pi 3: Raspbian OS use for Home Samba Server and Test HTTP Server

Page 1 of 5 123 ... LastLast

Similar Threads

  1. tankwars petr schreiber - psch
    By Petr Schreiber in forum TBGL nmg_tankwars
    Replies: 16
    Last Post: 31-05-2008, 18:14

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
  •