The discussion of the Alien series of films and the props used in them is the aim, but if it's got Big Bugs and Big Guns, then they are welcome too!





Post new topic Reply to topic  [ 59 posts ]  Go to page Previous  1, 2, 3
Author Message
 Post subject:
PostPosted: Thu Apr 22, 2021 8:09 pm 

Service Number: A05/TQ2.0.32141E1
Country: United States
I will also add that I am trying to get developer credentials and access with xbox and sony to try and port this over to those platforms and with xbox I might be able to cross port to IOS and Android. If I have to learn a few new languages to make this happen I will do so.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: idea on flash replacement for sentry gun terminal progra
PostPosted: Thu Apr 22, 2021 8:11 pm 
User avatar

Location: Surrey B.C.
Service Number: A01/TQ2.0.92244F1
Country: Canada
it was a grid compass 1139 with a 512x256 ELD screen as in above pics. custom bitmaps graphics i would guess , most likely done running a custom dos 2.11 .as the compass was not ibm compatable.
when i did mine i had to do it in asm to get the counters up to speed,


Top
 Profile  
Reply with quote  
 Post subject: Re: idea on flash replacement for sentry gun terminal progra
PostPosted: Thu Apr 22, 2021 8:50 pm 

Service Number: A05/TQ2.0.32141E1
Country: United States
Klyball wrote:
it was a grid compass 1139 with a 512x256 ELD screen as in above pics. custom bitmaps graphics i would guess , most likely done running a custom dos 2.11 .as the compass was not ibm compatable.
when i did mine i had to do it in asm to get the counters up to speed,


I will play with things this weekend and see what I can change. I am afraid that there might not be much I can do about height but I will see what leeway I have with the plugins.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: idea on flash replacement for sentry gun terminal progra
PostPosted: Sat Apr 24, 2021 12:45 am 
User avatar

Location: Surrey B.C.
Service Number: A01/TQ2.0.92244F1
Country: Canada
I found some of my files, i believe these are the bit mapped fonts,

Attachment:
fonts.zip [11.11 KiB]
Downloaded 103 times


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 24, 2021 4:47 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
I posted updated font file on sentry gun font thread.

Here:
viewtopic.php?f=3&t=19399&p=271767#p271767

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 24, 2021 4:51 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
I tweaked to 512x256. I had to edit first header title row to remove the carriage return to make it fit. I will have to redraw the splash screen accordingly. Though a canvas could work on it, maybe but text would be a fun deal.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sat Apr 24, 2021 7:48 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
OK, I redid the splash screen. It is now natively rendering everything without the need for external images to load. There is not much I can do about the progress bar background but I may need to see if there are any ttk.tkinter themes that I could load that might have a better layout for the progressbar.

It is amazing what a little break and a few days to chew on things enables one to accomplish coming back to things again.

Code:
import tkinter as tk
from tkinter import *
#import PIL.ImageTk
#import image
#import PIL
#import PIL.Image
import tkinter.ttk as ttk
import datetime as dt
import time
import os
from tkinter import messagebox
from collections import deque
from itertools import islice
from threading import Thread
from playsound import playsound

#
# global variables will be declared here
GUN = ""

# sets ammo count to initial value of 500
INITIAL_COUNTER_VALUE = 500
# sets initial time at 100%
INITIAL_TIMER_VALUE = 33000
# sets initial gun terminal ID
#sets gun rate
RMMAX = 0
# sets initial temparature
TEMP_INITIAL = 20
# sets text string for ammo/temp/low ammo status button
STATUS = ""

COOLED = 20

# end global variables section
#
# This is the initial screen that loads and then disappears after 8 seconds
# I used 3 images to make the main deal.  The issue was that pygame allowed for line draws
# tkinter only allows for drawing of boxes. 
# should this change I will change from using images.


class SplashFrame(tk.Toplevel):
    def __init__(splash, *args, **kwargs):
        super().__init__(*args, **kwargs)
  #      tk.Label(splash, text='SplashFrame').grid(row=0, column=4, columnspan=2, sticky="NEW")
        splash.geometry('512x256')
        splash.title("Inititaling")
        splash.configure(background='black')
        splash.overrideredirect(True)
        splash.after(8000, splash.destroy)
        tk.Grid.rowconfigure(splash, 0, weight=1, uniform='a')
        tk.Grid.rowconfigure(splash, 1, weight=1, uniform='b')
        tk.Grid.rowconfigure(splash, 2, weight=1, uniform='b')
        tk.Grid.rowconfigure(splash, 3, weight=1, uniform='b')
        tk.Grid.rowconfigure(splash, 4, weight=1, uniform='b')
        tk.Grid.rowconfigure(splash, 5, weight=1, uniform='b')
        tk.Grid.rowconfigure(splash, 6, weight=1, uniform='b')

        tk.Grid.columnconfigure(splash, 0, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 1, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 2, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 3, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 4, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 5, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 6, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 7, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 8, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 9, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 10, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 11, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 12, weight=1, uniform='d')
        styled = ttk.Style()
#('winnative', 'clam', 'alt', 'default', 'classic', 'vista', 'xpnative')
        styled.theme_use('default')
        styled.configure("TLabel", background='black', darkcolor='black', bordercolor='black', relief='none', lightcolor='black', highlightcolor='black', throughcolor='black', foreground='black', shiftrelief=-5, highlightthickness=0, width=0, anchor="NSEW")
        styled.configure("Horizontal.TProgressbar", foreground = 'black', background = 'yellow', bordercolor='black', darkcolor='black', throughcolor='black', lightcolor='black')
        loadingbar = ttk.Progressbar(splash, style="Horizontal.TProgressbar", orient="horizontal", length = 50, mode='indeterminate', maximum=100)
        loadingbar.grid(row=4, column=4, columnspan=2, sticky="NEW")
        loadingbar.start([48])
        tk.Label(splash, text="System Initializing", bg='black', fg='yellow').grid(row=3, column=4, columnspan=2, sticky="SEW")
        tk.Button(splash, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', highlightthickness=0, bd=0, borderwidth=0, justify=tk.CENTER, text="UA 571-C \n REMOTE SENTRY WEAPON SYSTEM").grid(row=2, column=2, columnspan=6, sticky="NEWS")       
        splash.canvas = tk.Canvas(splash, width=50, height=50, bg='black', highlightthickness=0)
        splash.canvas.create_line(5,5,50,5, fill='yellow')
        splash.canvas.create_line(5,5,5,50, fill='yellow')
        splash.canvas.grid(row=0, column=0, rowspan=2, columnspan=2)

        splash.canvasright = tk.Canvas(splash, width=50, height=50, bg='black', highlightthickness=0)
        splash.canvasright.create_line(5,5,45,5, fill='yellow')
        splash.canvasright.create_line(45,5,45,45, fill='yellow')
        splash.canvasright.grid(row=0, column=11, rowspan=2, columnspan=2)

        splash.canvasbotright = tk.Canvas(splash, width=50, height=50, bg='black', highlightthickness=0)
        splash.canvasbotright.create_line(5,45,45,45, fill='yellow')
        splash.canvasbotright.create_line(45,5,45,45, fill='yellow')
        splash.canvasbotright.create_text(22,27, fill='yellow', text="  28R \n LM 12", justify=tk.RIGHT)
        splash.canvasbotright.grid(row=5, column=11, rowspan=2, columnspan=2)

        splash.canvasbotleft = tk.Canvas(splash, width=50, height=50, bg='black', highlightthickness=0)
        splash.canvasbotleft.create_line(5,45,45,45, fill='yellow')
        splash.canvasbotleft.create_line(5,5,5,45, fill='yellow')
        splash.canvasbotleft.create_text(25, 35, text="V5.48", fill='yellow')
        splash.canvasbotleft.grid(row=5, column=0, rowspan=2, columnspan=2)


#
# End of splash screen defined class and related functions
#




#------------begin select screen------------------------------
# Begin select menu defined class and related functions
# This is the script's core window so more code will be present here than in other sections

# This is the next screen to load after the initial splash screen
class TkApp(tk.Tk):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.geometry('512x256')
        self.title("Select Screen")
        self.configure(bg='black')
        self.gun = tk.StringVar()
        self.gun.set(GUN)
        # Specify Grid
        tk.Grid.rowconfigure(self, 0, weight=1, uniform='a')
        tk.Grid.rowconfigure(self, 1, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 2, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 3, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 4, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 5, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 6, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 7, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 8, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 9, weight=1, uniform='b')
        tk.Grid.columnconfigure(self, 0, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 1, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 2, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 3, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 4, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 5, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 6, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 7, weight=1, uniform='d')


        button_1 = tk.Button(self, justify=tk.CENTER, text="AUTO-REMOTE", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        button_2 = tk.Button(self, justify=tk.CENTER, text="HARD", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        button_3 = tk.Button(self, justify=tk.CENTER, text="SEMIHARD", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        button_4 = tk.Button(self, justify=tk.CENTER, text="SOFT", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        sbutton_1 = tk.Button(self, justify=tk.CENTER, text="BIO", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        sbutton_2 = tk.Button(self, justify=tk.CENTER, text="INERT", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        tsbutton_1 = tk.Button(self, justify=tk.CENTER, text="MULTI SPEC", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        tsbutton_2 = tk.Button(self, justify=tk.CENTER, text="INFRA RED", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        tsbutton_3 = tk.Button(self, justify=tk.CENTER, text="UV", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        wsbutton_1 = tk.Button(self, justify=tk.CENTER, text="SAFE", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        wsbutton_2 = tk.Button(self, justify=tk.CENTER, text="ARMED", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        isbutton_1 = tk.Button(self, justify=tk.CENTER, text="SEARCH", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        isbutton_2 = tk.Button(self, justify=tk.CENTER, text="TEST", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        isbutton_3 = tk.Button(self, justify=tk.CENTER, text="ENGAGED", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        isbutton_4 = tk.Button(self, justify=tk.CENTER, text="INTERROGATE", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        trbutton_1 = tk.Button(self, justify=tk.CENTER, text="AUTO", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        trbutton_2 = tk.Button(self, justify=tk.CENTER, text="SELECTIVE", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        smman = tk.Button(self, justify=tk.CENTER, text="MAN-OVERRIDE", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        smauto = tk.Button(self, justify=tk.CENTER, text="SEMI-AUTO", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        # displays gun id on top left and right of screen
        gun_1 = tk.Button(self, borderwidth=7,bg='black',fg='yellow',disabledforeground='yellow',state=tk.DISABLED,textvariable=self.gun, highlightcolor = 'yellow')
        gun_2 = tk.Button(self, borderwidth=7,bg='black',fg='yellow',disabledforeground='yellow',state=tk.DISABLED,textvariable=self.gun)
        headernew = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="UA         571-C \n REMOTE SENTRY WEAPON SYSTEM")
        syst = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="SYSTEM MODE")
        weap = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="WEAPON STATUS")
        iff = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="IFF STATUS")
        test = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="TEST ROUTINE")
        target = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="TARGET PROFILE")
        spectral = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="SPECTRAL PROFILE")
        ts = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="TARGET SELECT")
        gun_1.grid(row=0, column=0, ipadx=2, ipady=2, padx=2, pady=2, sticky=W)
        gun_2.grid(row=0, column=7, ipadx=2, ipady=2, padx=2, pady=2, sticky=E)
        headernew.grid(row=0, column=1, columnspan=6, sticky="NSEW")
        button_1.grid(row=2, column=0, columnspan=2, sticky="NSEW")
        button_2.grid(row=9, column=0, columnspan=3, sticky="NSEW")
        button_3.grid(row=8, column=0, columnspan=3, sticky="NSEW")
        button_4.grid(row=7, column=0, columnspan=3, sticky="NSEW")
        sbutton_1.grid(row=7, column=3, columnspan=2, sticky="NSEW")
        sbutton_2.grid(row=8, column=3, columnspan=2, sticky="NSEW")
        tsbutton_1.grid(row=7, column=5, columnspan=3, sticky="NSEW")
        tsbutton_2.grid(row=8, column=5, columnspan=3, sticky="NSEW")
        tsbutton_3.grid(row=9, column=5, columnspan=3, sticky="NSEW")
        wsbutton_1.grid(row=2, column=2, columnspan=2, sticky="NSEW")
        wsbutton_2.grid(row=3, column=2, columnspan=2, sticky="NSEW")
        isbutton_1.grid(row=2, column=4, columnspan=2, sticky="NSEW")
        isbutton_2.grid(row=3, column=4, columnspan=2, sticky="NSEW")
        isbutton_3.grid(row=4, column=4, columnspan=2, sticky="NSEW")
        isbutton_4.grid(row=5, column=4, columnspan=2, sticky="NSEW")
        trbutton_1.grid(row=2, column=6, columnspan=2, sticky="NSEW")
        trbutton_2.grid(row=3, column=6, columnspan=2, sticky="NSEW")
        smman.grid(row=3, column=0, columnspan=2, sticky="NSEW")
        smauto.grid(row=4, column=0, columnspan=2, sticky="NSEW")
        syst.grid(row=1, column=0, columnspan=2, sticky="NSEW")
        weap.grid(row=1, column=2, columnspan=2, sticky="NSEW")
        iff.grid(row=1, column=4, columnspan=2, sticky="NSEW")
        test.grid(row=1, column=6, columnspan=2, sticky="NSEW")
        target.grid(row=6, column=0, columnspan=3, sticky="NSEW")
        spectral.grid(row=6, column=3, columnspan=2, sticky="NSEW")
        ts.grid(row=6, column=5, columnspan=3, sticky="NSEW")
        # this quits by clicking a button labeled q
        quit = tk.Button(self, bg='black', fg='yellow', text='q', command=self.quit)
        quit.grid(row=8,column=0,sticky="SW")
        self.bind('<KeyPress-Down>', self.on_down)
        self.bind("<Up>", self.on_up)
        self.bind("<Left>", self.on_left)
        self.bind("<Right>", self.on_right)
        self.bind("<KeyPress-a>", self.on_keypress_a)
        self.bind("<KeyPress-b>", self.on_keypress_b)
        self.bind("<KeyPress-c>", self.on_keypress_c)
        self.bind("<KeyPress-d>", self.on_keypress_d)
        self.bind("<KeyPress-q>", self.on_keypress_q)
        tk.Button(self, text='SecondFrame', command=self.on_button, bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow').grid(row=9, column=0, sticky="SW")
        self.create_splashframe()
        # These are the bind key definitions
        self.bind("<KeyPress-r>", self.on_keypress_r)
        self.bind("<KeyPress-space>", self.on_keypress_space)
        self.bind("<KeyPress-k>", self.on_keypress_k)
        self.group1 = deque((button_1, smman, smauto))
        self.group2 = deque((wsbutton_1, wsbutton_2))
        self.group3 = deque((isbutton_1, isbutton_2, isbutton_3, isbutton_4))
        self.group4 = deque((trbutton_1, trbutton_2))
        self.group5 = deque((button_4, button_3, button_2))
        self.group6 = deque((sbutton_1, sbutton_2))
        self.group7 = deque((tsbutton_1, tsbutton_2, tsbutton_3))
        self.header_group = deque(((syst, self.group1), (weap, self.group2),(iff, self.group3), (test, self.group4),(target, self.group5), (spectral, self.group6),(ts, self.group7)))
        self.start_with_first_selected(False)
        self.toggle_header_group(self.header_group)
 
    def toggle_button_group(self, button_group):
        button_group[0].config(foreground='black', background='yellow', relief='sunken')
        for button in islice(button_group, 1, None):
            button.config(foreground='yellow', background='black', relief='raised')
 
 
    def toggle_header_group(self, header_group):
        header_group[0][0].config(disabledforeground='black', background='yellow', relief='sunken')
        for button in islice(self.header_group, 1, None):
            button[0].config(disabledforeground='yellow',background='black', relief='raised')
 
 
    def start_with_first_selected(self, first_selected=False):
        if first_selected:
           toggle_button_group(self.group1)
           toggle_button_group(self.group2)
           toggle_button_group(self.group3)
           toggle_button_group(self.group4)
           toggle_button_group(self.group5)
           toggle_button_group(self.group6)
           toggle_button_group(self.group7)
        else:
        # set last of each group to selected
           self.group1.rotate(1)
           self.group2.rotate(1)
           self.group3.rotate(1)
           self.group4.rotate(1)
           self.group5.rotate(1)
           self.group6.rotate(1)
           self.group7.rotate(1)
       

 
    def on_down(self, evet):
       group = self.header_group[0][1]
       group.rotate(-1)
       self.toggle_button_group(group)
       playsound("click1.mp3")
 
    def on_up(self, evet):
       group = self.header_group[0][1]
       group.rotate(1)
       self.toggle_button_group(group)
       playsound("click1.mp3")
 
    def on_left(self, evet):
       self.header_group.rotate(1)
       self.toggle_header_group(self.header_group)
       playsound("click1.mp3")
 
    def on_right(self, evet):
       self.header_group.rotate(-1)
       self.toggle_header_group(self.header_group)
       playsound("click1.mp3")





 # this appears to launch the initial window
    def create_splashframe(self):
        splashframe = SplashFrame(self)
        self.withdraw()
        self.wait_window(splashframe)
        self.deiconify()
# this launches the next screen, the fire select screen
    def on_button(self):
        secondframe = SecondFrame(self)
        self.withdraw()
        self.wait_window(secondframe)
        self.deiconify()

    def kudos(self):
        kudosframe = KudosFrame(self)
        self.withdraw()
        self.wait_window(kudosframe)
        self.deiconify()

    def on_keypress_k(self, evet):
        print("k pressed")
        self.kudos()
        playsound("click1.mp3")
    # these work
    def on_keypress_a(self, evet):
        which_gun = self.gun.get()
        which_gun = "A"
        self.gun.set(which_gun)
        playsound("click1.mp3")
    def on_keypress_b(self, evet):
        which_gun = self.gun.get()
        which_gun = "B"
        self.gun.set(which_gun)
        playsound("click1.mp3")
    def on_keypress_c(self, evet):
        which_gun = self.gun.get()
        which_gun = "C"
        self.gun.set(which_gun)
        playsound("click1.mp3")
    def on_keypress_d(self, evet):
        which_gun = self.gun.get()
        which_gun = "D"
        self.gun.set(which_gun)
        playsound("click1.mp3")

# this launches you to window three, the fire select window
    def on_keypress_space(self, evet):
        print("space pressed")
        self.on_button()
        playsound("click1.mp3")
# this quits and closes the window by hitting a single key
    def on_keypress_q(self, evet):
        self.quit()
        playsound("click1.mp3")
# this reloads the game, you have to click it to make it the active window again
    def on_keypress_r(self, evet):
        self.destroy()
        self.__init__()
        playsound("click1.mp3")



#
#
#
#
# this is the third fire screen
class SecondFrame(tk.Toplevel):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.geometry('512x256')
        self.configure(bg='black')
        self.title("Fire status screen")
        tk.Grid.rowconfigure(self, 0, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 0, weight=1, uniform='a')
        tk.Button(self, text='Close', command=self.destroy, bg='black', fg='yellow', highlightbackground='yellow', highlightcolor='black',activebackground='yellow').grid(row=8, column=1, sticky="NSEW")
         # locally initialize ammo count down
        self.counter = tk.IntVar()
        self.counter.set(INITIAL_COUNTER_VALUE)
        # locally sets the timer count down at 100%
        self.timer = tk.IntVar()
        self.timer.set(INITIAL_TIMER_VALUE)
        # locally sets rmbar to 0%
        self.rmcount = tk.IntVar()
        self.rmcount.set(RMMAX)
        # locally sets tempbar
        self.temperature = tk.IntVar()
        self.temperature.set(TEMP_INITIAL)
        # locally sets text string for ammo status button
        self.stat = tk.StringVar()
        self.stat.set(STATUS)
        #
        self.cooldown = tk.IntVar()
        self.stat.set(COOLED)

        self.gun = tk.StringVar()
        self.gun.set(GUN)

        # this arranges the grid row and column groupings. 
        tk.Grid.rowconfigure(self, 0, weight=1, uniform='c')
        tk.Grid.rowconfigure(self, 1, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 2, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 3, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 4, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 5, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 6, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 7, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 8, weight=1, uniform='b')
        tk.Grid.columnconfigure(self, 0, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 1, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 2, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 3, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 4, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 5, weight=1, uniform='a')
        # these are the button and label declarations
        rounds = tk.Label(self, justify=tk.CENTER, textvariable=self.counter)
        rounds.grid(row=3, column=2, columnspan=1, sticky="EW")
        label1 = tk.Label(self, textvariable=self.timer)
        label1.grid(row=7, column=2, sticky="EW")

        temp = tk.Button(self,justify=tk.CENTER,text="Temp",bg='black', fg='yellow', highlightbackground='yellow', highlightcolor='black',activebackground='yellow')
        temp.grid(row=2,column=4,sticky="NSEW")

        rm = tk.Button(self,justify=tk.CENTER,text="R(M)",bg='black', fg='yellow', highlightbackground='yellow', highlightcolor='black',activebackground='yellow')
        rm.grid(row=2,column=5,sticky="NSEW")
        # rounds rate bar
        rmbar = ttk.Progressbar(self, orient="vertical", variable=self.rmcount)
        rmbar.grid(row=3,column=5,rowspan=6, sticky="NS")

        # temperature bar
        tempbar = ttk.Progressbar(self, orient="vertical", variable=self.temperature)
        tempbar.grid(row=3,column=4,rowspan=6,sticky="NS")

        # declarative buttons
        timestat = tk.Button(self,bg='black',state=tk.DISABLED, fg='yellow',disabledforeground='yellow',highlightbackground='yellow',borderwidth=2,justify=tk.CENTER,text="TIME AT 100% \n (msecs)")
        timestat.grid(row=7,column=0,columnspan=2,sticky="NSEW")
        roundsr = tk.Button(self,bg='black',state=tk.DISABLED, fg='yellow',disabledforeground='yellow',highlightbackground='yellow',borderwidth=2,justify=tk.CENTER,text="Rounds \n Remaining")
        roundsr.grid(row=3,column=0,columnspan=2,sticky="NS")


        # crit menu bar
        crit = tk.Button(self,justify=tk.CENTER,textvariable=self.stat, bg='black', fg='yellow', highlightbackground='yellow', highlightcolor='black',activebackground='yellow')
        crit.grid(row=5,column=0,columnspan=2,sticky="NSEW")
       

        # static center header
        headernew = tk.Button(self, bg='black',state=tk.DISABLED,justify=tk.CENTER, text="UA 571-C \n REMOTE SENTRY WEAPON SYSTEM")
        headernew.grid(row=0,column=1,columnspan=4,rowspan=2,sticky="NSEW")




        # displays gun id on top left and right of screen
        gun_1 = tk.Button(self, borderwidth=7,bg='black',fg='yellow',disabledforeground='yellow',state=tk.DISABLED,textvariable=self.gun, highlightcolor = 'yellow')
        gun_1.grid(row=0,column=0,rowspan=2,sticky="NS")
        gun_2 = tk.Button(self, borderwidth=7,bg='black',fg='yellow',disabledforeground='yellow',state=tk.DISABLED,textvariable=self.gun)
        gun_2.grid(row=0,column=5,rowspan=2,sticky="NS")


        # this quits by clicking a button labeled q
        quit = tk.Button(self, bg='black', fg='yellow', text='q', command=self.quit)
        quit.grid(row=8,column=0,sticky="SW")

        # these are the attachments for input from keyboard into the application
        # These are the button inputs from the original flash app that were used
        # I added a q as well to quit and close window in case there was a need to close

        self.bind("<KeyPress-f>", self.on_keypress_f)
        self.bind("<KeyRelease-f>", self.on_keyrelease_f)
        self.bind("<KeyPress-a>", self.on_keypress_a)
        self.bind("<KeyPress-b>", self.on_keypress_b)
        self.bind("<KeyPress-c>", self.on_keypress_c)
        self.bind("<KeyPress-d>", self.on_keypress_d)
        # These are the bind key definitions
        self.bind("<KeyPress-r>", self.on_keypress_r)
        self.bind("<KeyPress-q>", self.on_keypress_q)
        self.bind("<KeyPress-space>", self.on_keypress_space)
        self.bind("<KeyPress-k>", self.on_keypress_k)
    def coolbar(self):
        temperature_count = self.temperature.get()
        if temperature_count >= 21:
          temperature_count = self.temperature.get()
          temperature_count = temperature_count-1 or TEMP_INITIAL     
          self.temperature.set(temperature_count)
          print("key not pressed", temperature_count)
          self.after(300, self.coolbar)
   

    def overheat(self):
        rmcount_count = self.rmcount.get()
        rmcount_count = 0
        self.rmcount.set(rmcount_count)
        state_stat = self.stat.get()
        state_stat = "OVERHEAT"
        self.stat.set(state_stat)
        playsound("warning1.mp3")
        time.sleep(0.7)

    def critical(self):
        counter_value = self.counter.get()
        if counter_value <= 50:
          counter_value = self.counter.get()
          state_stat = self.stat.get()
          state_stat = "CRITICAL"
          self.stat.set(state_stat)
          playsound("warning1.mp3")
          counter_value = self.counter.get()
          print("ammo CRIT", counter_value)

    def out(self):
        counter_value = self.counter.get()
        if counter_value == 1:
          state_stat = self.stat.get()
          state_stat = "OUT"
          self.stat.set(state_stat)
          playsound("warning1.mp3")
          counter_value = self.counter.get()
          print("ammo CRIT", counter_value)

    def reload(self):
        counter_value = self.counter.get()
        if counter_value >= 1:
          state_stat = self.stat.get()
          state_stat = ""
          self.stat.set(state_stat)
          counter_value = self.counter.get()
          print("ammo CRIT", counter_value)


    # this defines the fire ammo count down sequence and resets
    def on_keypress_f(self, evet):       
        counter_value = self.counter.get()
        counter_value = counter_value-1 or INITIAL_COUNTER_VALUE
        self.counter.set(counter_value)
        counter_value = self.counter.get()
        # this is logic to try and get ammo warnings
        counter_value = self.counter.get()

        self.reload()
        self.critical()
        self.out()

 
        # this sets the time at 100%
        timer_value = self.timer.get()
        timer_value = timer_value-66 or INITIAL_TIMER_VALUE
        self.timer.set(timer_value)
        # this sets the rmbar to 40%
        rmcount_count = self.rmcount.get()
        rmcount_count = 40
        self.rmcount.set(rmcount_count)
        # this sets the temperature
        temperature_count =  self.temperature.get()
        temperature_count = temperature_count+1
        self.temperature.set(temperature_count)
        if temperature_count == 90:
          self.coolbar()
          self.overheat()
        else:
          state_stat = self.stat.get()
          state_stat = ""
          self.stat.set(state_stat)

    def on_keyrelease_f(self, evet):
        #this adds logic to say rate is zero if not firing
        #this automatically turns off rate bar moment key is released fixing a logic issue
        rmcount_count = self.rmcount.get()
        rmcount_count = 0
        self.rmcount.set(rmcount_count)
        temperature_count =  self.temperature.get()
        if temperature_count >= 20:
          self.coolbar()

 # this appears to launch the initial window
 #   def create_splashframe(self):
  #      splashframe = SplashFrame(self)
   #     self.withdraw()
    #    self.wait_window(splashframe)
     #   self.deiconify()
# this launches the next screen, the fire select screen
    def on_button(self):
        secondframe = SecondFrame(self)
        self.withdraw()
        self.wait_window(secondframe)
        self.deiconify()



    def kudos(self):
        kudosframe = KudosFrame(self)
        self.withdraw()
        self.wait_window(kudosframe)
        self.deiconify()


    def on_keypress_k(self, evet):
        print("k pressed")
        self.kudos()
        playsound("click1.mp3")
# this reloads the game, you have to click it to make it the active window again
    def on_keypress_r(self, evet):
        self.destroy()
        self.create_splashframe
        playsound("click1.mp3")
# this launches you to window three, the fire select window
    def on_keypress_space(self, evet):
        print("space pressed")
        self.on_button()
        playsound("click1.mp3")
# this quits and closes the window by hitting a single key
    def on_keypress_q(self, evet):
        self.destroy()
        self.quit()
        playsound("click1.mp3")

    # this sets the gun terminal identification
    # this can also be expanded to do other things if you want to alter the script
    def on_keypress_a(self, evet):
        which_gun = self.gun.get()
        which_gun = "A"
        self.gun.set(which_gun)

        playsound("click1.mp3")

    def on_keypress_b(self, evet):
        which_gun = self.gun.get()
        which_gun = "B"
        self.gun.set(which_gun)

        playsound("click1.mp3")

    def on_keypress_c(self, evet):
        which_gun = self.gun.get()
        which_gun = "C"
        self.gun.set(which_gun)

        playsound("click1.mp3")

    def on_keypress_d(self, evet):
        which_gun = self.gun.get()
        which_gun = "D"
        self.gun.set(which_gun)

        playsound("click1.mp3")


#
#
# End fire menu class and related functions
#
#
#Begin secret credits(kudos) screen
#
#

class KudosFrame(tk.Toplevel):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.geometry('512x256')
        self.title("Secret credits screen")
        tk.Grid.rowconfigure(self, 0, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 0, weight=1, uniform='a')
        tk.Grid.rowconfigure(self, 1, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 1, weight=1, uniform='a')

        r0c0 = tk.Button(self, text='Close', command=self.destroy, bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        r0c0.grid(row=0, column=0, sticky="NSEW")
        r1c0 = tk.Label(self, text ='Alienslegacy.com Credits \n knoxvilles_joker aka gabriel vos new script  \n martinr1000 font and some coding help \n MLR 2007 for original flash script \n Facebook.com  theuscm \n youtube.com/channel/UC4KYYScA5WcdCZeiU6lcjdA \n cobra_shipwreck channel aka knoxvilles_joker', bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        r1c0.grid(row=1, column=0, sticky="NSEW")
        r1c1 = tk.Label(self, text =' ', bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        r1c1.grid(row=1, column=1, sticky="NSEW")
        r0c1 = tk.Label(self, text ='Python-forum.io credits \n Yoriz coding pointers and help \n ndc85430 coding critique \n ', bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        r0c1.grid(row=0, column=1, sticky="NSEW")

        # These are the bind key definitions
        self.bind("<KeyPress-r>", self.on_keypress_r)
        self.bind("<KeyPress-space>", self.on_keypress_space)
        self.bind("<KeyPress-k>", self.on_keypress_k)
        self.bind("<KeyPress-q>", self.on_keypress_q)

    def on_button(self):
        secondframe = SecondFrame(self)
        self.withdraw()
        self.wait_window(secondframe)
        self.deiconify()
    def kudos(self):
        kudosframe = KudosFrame(self)
        self.withdraw()
        self.wait_window(kudosframe)
        self.deiconify()
# this reloads the game, you have to click it to make it the active window again
    def on_keypress_r(self, evet):
        self.destroy()         
        self.create_splashframe # this appears to launch the initial window       
    def on_keypress_r(self, evet):
        print("r pressed")       
        self.destroy()
  #      self.create_splashframe
        playsound("click1.mp3")
    def on_keypress_k(self, evet):
        print("k pressed")       
        self.kudos()
        playsound("click1.mp3")
# this launches you to window three, the fire select window
    def on_keypress_space(self, evet):
        print("space pressed")
        self.on_button()
        playsound("click1.mp3")
# this quits and closes the window by hitting a single key
    def on_keypress_q(self, evet):
        self.destroy()
        self.quit()
        playsound("click1.mp3")
#
# End secret credits(kudos) screen
#
#
#
# The below two commands run the entire script

tk_app = TkApp()
tk_app.mainloop()

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject: Re: idea on flash replacement for sentry gun terminal progra
PostPosted: Mon Apr 26, 2021 3:43 am 

Service Number: A05/TQ2.0.32141E1
Country: United States
latest build. gun identifier renders and windows are now always on top.

Code:
import tkinter as tk
from tkinter import *
#import PIL.ImageTk
#import image
#import PIL
#import PIL.Image
import tkinter.ttk as ttk
import datetime as dt
import time
import os
from tkinter import messagebox
from collections import deque
from itertools import islice
from threading import Thread
from playsound import playsound

#
# global variables will be declared here
GUN = ""

# sets ammo count to initial value of 500
INITIAL_COUNTER_VALUE = 500
# sets initial time at 100%
INITIAL_TIMER_VALUE = 33000
# sets initial gun terminal ID
#sets gun rate
RMMAX = 0
# sets initial temparature
TEMP_INITIAL = 20
# sets text string for ammo/temp/low ammo status button
STATUS = ""

COOLED = 20

# end global variables section
#
# This is the initial screen that loads and then disappears after 8 seconds
# I used 3 images to make the main deal.  The issue was that pygame allowed for line draws
# tkinter only allows for drawing of boxes. 
# should this change I will change from using images.


# this defines the splash frame
class SplashFrame(tk.Toplevel):
    def __init__(splash, *args, **kwargs):
        super().__init__(*args, **kwargs)
        splash.geometry('512x256')
        splash.title("Inititaling")
        splash.configure(background='black')
        splash.overrideredirect(True)
        splash.after(3000, splash.destroy)
        splash.focus_set()
        splash.focus_force()
        tk.Grid.rowconfigure(splash, 0, weight=1, uniform='a')
        tk.Grid.rowconfigure(splash, 1, weight=1, uniform='b')
        tk.Grid.rowconfigure(splash, 2, weight=1, uniform='b')
        tk.Grid.rowconfigure(splash, 3, weight=1, uniform='b')
        tk.Grid.rowconfigure(splash, 4, weight=1, uniform='b')
        tk.Grid.rowconfigure(splash, 5, weight=1, uniform='b')
        tk.Grid.rowconfigure(splash, 6, weight=1, uniform='b')

        tk.Grid.columnconfigure(splash, 0, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 1, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 2, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 3, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 4, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 5, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 6, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 7, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 8, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 9, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 10, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 11, weight=1, uniform='d')
        tk.Grid.columnconfigure(splash, 12, weight=1, uniform='d')
        styled = ttk.Style()
#('winnative', 'clam', 'alt', 'default', 'classic', 'vista', 'xpnative')
        styled.theme_use('default')
        styled.configure("TLabel", background='black', darkcolor='black', bordercolor='black', relief='none', lightcolor='black', highlightcolor='black', throughcolor='black', foreground='black', shiftrelief=-5, highlightthickness=0, width=0, anchor="NSEW")
        styled.configure("Horizontal.TProgressbar", foreground = 'black', background = 'yellow', bordercolor='black', darkcolor='black', throughcolor='black', lightcolor='black')
        loadingbar = ttk.Progressbar(splash, style="Horizontal.TProgressbar", orient="horizontal", length = 50, mode='indeterminate', maximum=100)
        loadingbar.grid(row=4, column=4, columnspan=2, sticky="NEW")
        loadingbar.start([48])
        tk.Label(splash, text="SYSTEM INITIALIZING", bg='black', fg='yellow', font="sentryTerminalfi 6").grid(row=3, column=4, columnspan=2, sticky="SEW")
        tk.Button(splash, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', highlightthickness=0, bd=0, borderwidth=0, justify=tk.CENTER, text="UA 571-C \n REMOTE SENTRY WEAPON SYSTEM", font="sentryTerminalfi 12").grid(row=2, column=2, columnspan=6, sticky="NEWS")       
        splash.canvas = tk.Canvas(splash, width=50, height=50, bg='black', highlightthickness=0)
        splash.canvas.create_line(5,5,50,5, fill='yellow', width=2)
        splash.canvas.create_line(5,5,5,50, fill='yellow', width=2)
        splash.canvas.grid(row=0, column=0, rowspan=2, columnspan=2)

        splash.canvasright = tk.Canvas(splash, width=50, height=50, bg='black', highlightthickness=0)
        splash.canvasright.create_line(5,5,45,5, fill='yellow', width=2)
        splash.canvasright.create_line(45,5,45,45, fill='yellow', width=2)
        splash.canvasright.grid(row=0, column=11, rowspan=2, columnspan=2)

        splash.canvasbotright = tk.Canvas(splash, width=50, height=50, bg='black', highlightthickness=0)
        splash.canvasbotright.create_line(5,45,45,45, fill='yellow', width=2)
        splash.canvasbotright.create_line(45,5,45,45, fill='yellow', width=2)
        splash.canvasbotright.create_text(22,27, fill='yellow', text="  28R \n LM 12", justify=tk.RIGHT, font="sentryTerminalfi 8")
        splash.canvasbotright.grid(row=5, column=11, rowspan=2, columnspan=2)

        splash.canvasbotleft = tk.Canvas(splash, width=50, height=50, bg='black', highlightthickness=0)
        splash.canvasbotleft.create_line(5,45,45,45, fill='yellow', width=2)
        splash.canvasbotleft.create_line(5,5,5,45, fill='yellow', width=2)
        splash.canvasbotleft.create_text(25, 35, text="V5.48", fill='yellow', font="sentryTerminalfi 6")
        splash.canvasbotleft.grid(row=5, column=0, rowspan=2, columnspan=2)

#
# End of splash screen defined class and related functions
#




#------------begin select screen------------------------------
# Begin select menu defined class and related functions
# This is the script's core window so more code will be present here than in other sections

# This is the next screen to load after the initial splash screen
class TkApp(tk.Tk):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.geometry('512x256')
        self.update_idletasks()
        self.title("Select Screen")
        self.configure(bg='black')
        self.gun = tk.StringVar()
        self.gun.set(GUN)
        self.focus_set()
        self.focus_force()
        height = self.winfo_height()
        width = self.winfo_width()

        # Specify Grid
        tk.Grid.rowconfigure(self, 0, weight=1, uniform='a')
        tk.Grid.rowconfigure(self, 1, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 2, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 3, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 4, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 5, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 6, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 7, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 8, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 9, weight=1, uniform='b')
        tk.Grid.columnconfigure(self, 0, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 1, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 2, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 3, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 4, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 5, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 6, weight=1, uniform='d')
        tk.Grid.columnconfigure(self, 7, weight=1, uniform='d')


        button_1 = tk.Button(self, justify=tk.CENTER, text="AUTO-REMOTE", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        button_2 = tk.Button(self, justify=tk.CENTER, text="HARD", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        button_3 = tk.Button(self, justify=tk.CENTER, text="SEMIHARD", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        button_4 = tk.Button(self, justify=tk.CENTER, text="SOFT", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        sbutton_1 = tk.Button(self, justify=tk.CENTER, text="BIO", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        sbutton_2 = tk.Button(self, justify=tk.CENTER, text="INERT", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        tsbutton_1 = tk.Button(self, justify=tk.CENTER, text="MULTI SPEC", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        tsbutton_2 = tk.Button(self, justify=tk.CENTER, text="INFRA RED", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        tsbutton_3 = tk.Button(self, justify=tk.CENTER, text="UV", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        wsbutton_1 = tk.Button(self, justify=tk.CENTER, text="SAFE", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        wsbutton_2 = tk.Button(self, justify=tk.CENTER, text="ARMED", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        isbutton_1 = tk.Button(self, justify=tk.CENTER, text="SEARCH", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        isbutton_2 = tk.Button(self, justify=tk.CENTER, text="TEST", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        isbutton_3 = tk.Button(self, justify=tk.CENTER, text="ENGAGED", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        isbutton_4 = tk.Button(self, justify=tk.CENTER, text="INTERROGATE", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        trbutton_1 = tk.Button(self, justify=tk.CENTER, text="AUTO", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        trbutton_2 = tk.Button(self, justify=tk.CENTER, text="SELECTIVE", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        smman = tk.Button(self, justify=tk.CENTER, text="MAN-OVERRIDE", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        smauto = tk.Button(self, justify=tk.CENTER, text="SEMI-AUTO", bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        # displays gun id on top left and right of screen
        gun_1 = tk.Button(self, borderwidth=0,bg='black',fg='yellow',disabledforeground='yellow',state=tk.DISABLED,textvariable=self.gun, highlightcolor = 'yellow')
        self.canvasgun1 = tk.Canvas(self, width=height//10+3, height=height//10+3, bg='black', highlightthickness=0)
        self.canvasgun1.grid(row=0, column=0)
        self.canvasgun1.create_oval(0,0,height//10+3,height//10+3,outline='yellow', width=3)
        gun_1.lift()
        gun_2 = tk.Button(self, borderwidth=0,bg='black',fg='yellow',disabledforeground='yellow',state=tk.DISABLED,textvariable=self.gun)
        self.canvasgun2 = tk.Canvas(self, width=height//10+3, height=height//10+3, bg='black', highlightthickness=0)
        self.canvasgun2.grid(row=0, column=7)
        self.canvasgun2.create_oval(0,0,height//10+3,height//10+3,outline='yellow', width=3)
        gun_2.lift()

        self.canvasheader = tk.Canvas(self, width=width//4+3, height=height//10+3, bg='black', highlightthickness=0)
        self.canvasheader.grid(row=0, column=1, columnspan=6)
        self.canvasheader.create_line(5,5,width//4+3,5, fill='yellow', width=2)




        headernew = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=0, justify=CENTER, text="UA         571-C \n REMOTE SENTRY WEAPON SYSTEM")
        syst = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="SYSTEM MODE")
        weap = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="WEAPON STATUS")
        iff = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="IFF STATUS")
        test = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="TEST ROUTINE")
        target = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="TARGET PROFILE")
        spectral = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="SPECTRAL PROFILE")
        ts = tk.Button(self, bg='black', state=tk.DISABLED, fg='yellow', disabledforeground='yellow',highlightbackground='yellow', borderwidth=2, justify=CENTER, text="TARGET SELECT")
        gun_1.grid(row=0, column=0)
        gun_2.grid(row=0, column=7)
        headernew.grid(row=0, column=1, columnspan=6, sticky="NSEW")
        headernew.lift()
        button_1.grid(row=2, column=0, columnspan=2, sticky="NSEW")
        button_1.lift()
        button_2.grid(row=9, column=0, columnspan=3, sticky="NSEW")
        button_2.lift()
        button_3.grid(row=8, column=0, columnspan=3, sticky="NSEW")
        button_3.lift()
        button_4.grid(row=7, column=0, columnspan=3, sticky="NSEW")
        button_4.lift()
        sbutton_1.grid(row=7, column=3, columnspan=2, sticky="NSEW")
        sbutton_1.lift()
        sbutton_2.grid(row=8, column=3, columnspan=2, sticky="NSEW")
        sbutton_2.lift()
        tsbutton_1.grid(row=7, column=5, columnspan=3, sticky="NSEW")
        tsbutton_1.lift()
        tsbutton_2.grid(row=8, column=5, columnspan=3, sticky="NSEW")
        tsbutton_2.lift()
        tsbutton_3.grid(row=9, column=5, columnspan=3, sticky="NSEW")
        tsbutton_3.lift()
        wsbutton_1.grid(row=2, column=2, columnspan=2, sticky="NSEW")
        wsbutton_1.lift()
        wsbutton_2.grid(row=3, column=2, columnspan=2, sticky="NSEW")
        wsbutton_2.lift()
        isbutton_1.grid(row=2, column=4, columnspan=2, sticky="NSEW")
        isbutton_1.lift()
        isbutton_2.grid(row=3, column=4, columnspan=2, sticky="NSEW")
        isbutton_2.lift()
        isbutton_3.grid(row=4, column=4, columnspan=2, sticky="NSEW")
        isbutton_3.lift()
        isbutton_4.grid(row=5, column=4, columnspan=2, sticky="NSEW")
        isbutton_4.lift()
        trbutton_1.grid(row=2, column=6, columnspan=2, sticky="NSEW")
        trbutton_1.lift()
        trbutton_2.grid(row=3, column=6, columnspan=2, sticky="NSEW")
        trbutton_2.lift()
        smman.grid(row=3, column=0, columnspan=2, sticky="NSEW")
        smman.lift()
        smauto.grid(row=4, column=0, columnspan=2, sticky="NSEW")
        smauto.lift()
        syst.grid(row=1, column=0, columnspan=2, sticky="NSEW")
        syst.lift()
        weap.grid(row=1, column=2, columnspan=2, sticky="NSEW")
        weap.lift()
        iff.grid(row=1, column=4, columnspan=2, sticky="NSEW")
        iff.lift()
        test.grid(row=1, column=6, columnspan=2, sticky="NSEW")
        test.lift()
        target.grid(row=6, column=0, columnspan=3, sticky="NSEW")
        target.lift()
        spectral.grid(row=6, column=3, columnspan=2, sticky="NSEW")
        spectral.lift()
        ts.grid(row=6, column=5, columnspan=3, sticky="NSEW")
        ts.lift()
        # this quits by clicking a button labeled q
        quit = tk.Button(self, bg='black', fg='yellow', text='q', command=self.quit)
        quit.grid(row=8,column=0,sticky="SW")
        quit.lift()
        self.bind('<KeyPress-Down>', self.on_down)
        self.bind("<Up>", self.on_up)
        self.bind("<Left>", self.on_left)
        self.bind("<Right>", self.on_right)
        self.bind("<KeyPress-a>", self.on_keypress_a)
        self.bind("<KeyPress-b>", self.on_keypress_b)
        self.bind("<KeyPress-c>", self.on_keypress_c)
        self.bind("<KeyPress-d>", self.on_keypress_d)
        self.bind("<KeyPress-q>", self.on_keypress_q)
        nextframe = tk.Button(self, text='SecondFrame', command=self.on_button, bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        nextframe.grid(row=9, column=0, sticky="SW")
        nextframe.lift()
        self.create_splashframe()
        # These are the bind key definitions
        self.bind("<KeyPress-r>", self.on_keypress_r)
        self.bind("<KeyPress-space>", self.on_keypress_space)
        self.bind("<KeyPress-k>", self.on_keypress_k)
        self.group1 = deque((button_1, smman, smauto))
        self.group2 = deque((wsbutton_1, wsbutton_2))
        self.group3 = deque((isbutton_1, isbutton_2, isbutton_3, isbutton_4))
        self.group4 = deque((trbutton_1, trbutton_2))
        self.group5 = deque((button_4, button_3, button_2))
        self.group6 = deque((sbutton_1, sbutton_2))
        self.group7 = deque((tsbutton_1, tsbutton_2, tsbutton_3))
        self.header_group = deque(((syst, self.group1), (weap, self.group2),(iff, self.group3), (test, self.group4),(target, self.group5), (spectral, self.group6),(ts, self.group7)))
        self.start_with_first_selected(False)
        self.toggle_header_group(self.header_group)
        print(height)
        print(width)
        print(height // 10)
        print(width // 8)
 
    def toggle_button_group(self, button_group):
        button_group[0].config(foreground='black', background='yellow', relief='sunken')
        for button in islice(button_group, 1, None):
            button.config(foreground='yellow', background='black', relief='raised')
 
 
    def toggle_header_group(self, header_group):
        header_group[0][0].config(disabledforeground='black', background='yellow', relief='sunken')
        for button in islice(self.header_group, 1, None):
            button[0].config(disabledforeground='yellow',background='black', relief='raised')
 
 
    def start_with_first_selected(self, first_selected=False):
        if first_selected:
           toggle_button_group(self.group1)
           toggle_button_group(self.group2)
           toggle_button_group(self.group3)
           toggle_button_group(self.group4)
           toggle_button_group(self.group5)
           toggle_button_group(self.group6)
           toggle_button_group(self.group7)
        else:
        # set last of each group to selected
           self.group1.rotate(1)
           self.group2.rotate(1)
           self.group3.rotate(1)
           self.group4.rotate(1)
           self.group5.rotate(1)
           self.group6.rotate(1)
           self.group7.rotate(1)
       

 
    def on_down(self, evet):
       group = self.header_group[0][1]
       group.rotate(-1)
       self.toggle_button_group(group)
       playsound("click1.mp3")
 
    def on_up(self, evet):
       group = self.header_group[0][1]
       group.rotate(1)
       self.toggle_button_group(group)
       playsound("click1.mp3")
 
    def on_left(self, evet):
       self.header_group.rotate(1)
       self.toggle_header_group(self.header_group)
       playsound("click1.mp3")
 
    def on_right(self, evet):
       self.header_group.rotate(-1)
       self.toggle_header_group(self.header_group)
       playsound("click1.mp3")





 # this appears to launch the initial window
    def create_splashframe(self):
        splashframe = SplashFrame(self)
        self.withdraw()
        self.wait_window(splashframe)
        self.deiconify()
# this launches the next screen, the fire select screen
    def on_button(self):
        secondframe = SecondFrame(self)
        self.withdraw()
        self.wait_window(secondframe)
        self.deiconify()

    def kudos(self):
        kudosframe = KudosFrame(self)
        self.withdraw()
        self.wait_window(kudosframe)
        self.deiconify()

    def on_keypress_k(self, evet):
        print("k pressed")
        self.kudos()
        playsound("click1.mp3")
    # these work
    def on_keypress_a(self, evet):
        which_gun = self.gun.get()
        which_gun = "A"
        self.gun.set(which_gun)
        playsound("click1.mp3")
    def on_keypress_b(self, evet):
        which_gun = self.gun.get()
        which_gun = "B"
        self.gun.set(which_gun)
        playsound("click1.mp3")
    def on_keypress_c(self, evet):
        which_gun = self.gun.get()
        which_gun = "C"
        self.gun.set(which_gun)
        playsound("click1.mp3")
    def on_keypress_d(self, evet):
        which_gun = self.gun.get()
        which_gun = "D"
        self.gun.set(which_gun)
        playsound("click1.mp3")

# this launches you to window three, the fire select window
    def on_keypress_space(self, evet):
        print("space pressed")
        self.on_button()
        playsound("click1.mp3")
# this quits and closes the window by hitting a single key
    def on_keypress_q(self, evet):
        self.quit()
        playsound("click1.mp3")
# this reloads the game, you have to click it to make it the active window again
    def on_keypress_r(self, evet):
        self.destroy()
        self.__init__()
        playsound("click1.mp3")



#
#
#
#
# this is the third fire screen
class SecondFrame(tk.Toplevel):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.geometry('512x256')
        self.configure(bg='black')
        self.title("Fire status screen")
        self.focus_set()
        self.focus_force()
        tk.Grid.rowconfigure(self, 0, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 0, weight=1, uniform='a')
        tk.Button(self, text='Close', command=self.destroy, bg='black', fg='yellow', highlightbackground='yellow', highlightcolor='black',activebackground='yellow').grid(row=8, column=1, sticky="NSEW")
         # locally initialize ammo count down
        self.counter = tk.IntVar()
        self.counter.set(INITIAL_COUNTER_VALUE)
        # locally sets the timer count down at 100%
        self.timer = tk.IntVar()
        self.timer.set(INITIAL_TIMER_VALUE)
        # locally sets rmbar to 0%
        self.rmcount = tk.IntVar()
        self.rmcount.set(RMMAX)
        # locally sets tempbar
        self.temperature = tk.IntVar()
        self.temperature.set(TEMP_INITIAL)
        # locally sets text string for ammo status button
        self.stat = tk.StringVar()
        self.stat.set(STATUS)
        #
        self.cooldown = tk.IntVar()
        self.stat.set(COOLED)

        self.gun = tk.StringVar()
        self.gun.set(GUN)

        # this arranges the grid row and column groupings. 
        tk.Grid.rowconfigure(self, 0, weight=1, uniform='c')
        tk.Grid.rowconfigure(self, 1, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 2, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 3, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 4, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 5, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 6, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 7, weight=1, uniform='b')
        tk.Grid.rowconfigure(self, 8, weight=1, uniform='b')
        tk.Grid.columnconfigure(self, 0, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 1, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 2, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 3, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 4, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 5, weight=1, uniform='a')
        styled = ttk.Style()
        styled.theme_use('default')
        styled.configure("Vertical.TProgressbar", foreground = 'black', background = 'yellow', bordercolor='black', darkcolor='black', throughcolor='black', lightcolor='black')
        # these are the button and label declarations
        rounds = tk.Label(self, justify=tk.CENTER, textvariable=self.counter)
        rounds.grid(row=3, column=2, columnspan=1, sticky="EW")
        label1 = tk.Label(self, textvariable=self.timer)
        label1.grid(row=7, column=2, sticky="EW")

        temp = tk.Button(self,justify=tk.CENTER,text="Temp",bg='black', fg='yellow', highlightbackground='yellow', highlightcolor='black',activebackground='yellow')
        temp.grid(row=2,column=4,sticky="NSEW")

        rm = tk.Button(self,justify=tk.CENTER,text="R(M)",bg='black', fg='yellow', highlightbackground='yellow', highlightcolor='black',activebackground='yellow')
        rm.grid(row=2,column=5,sticky="NSEW")
        # rounds rate bar
        rmbar = ttk.Progressbar(self, orient="vertical", variable=self.rmcount)
        rmbar.grid(row=3,column=5,rowspan=6, sticky="NS")

        # temperature bar
        tempbar = ttk.Progressbar(self, orient="vertical", variable=self.temperature)
        tempbar.grid(row=3,column=4,rowspan=6,sticky="NS")

        # declarative buttons
        timestat = tk.Button(self,bg='black',state=tk.DISABLED, fg='yellow',disabledforeground='yellow',highlightbackground='yellow',borderwidth=2,justify=tk.CENTER,text="TIME AT 100% \n (msecs)")
        timestat.grid(row=7,column=0,columnspan=2,sticky="NSEW")
        roundsr = tk.Button(self,bg='black',state=tk.DISABLED, fg='yellow',disabledforeground='yellow',highlightbackground='yellow',borderwidth=2,justify=tk.CENTER,text="Rounds \n Remaining")
        roundsr.grid(row=3,column=0,columnspan=2,sticky="NS")

 # crit menu bar
        crit = tk.Button(self,justify=tk.CENTER,textvariable=self.stat, bg='black', fg='yellow', highlightbackground='yellow', highlightcolor='black',activebackground='yellow')
        crit.grid(row=5,column=0,columnspan=2,sticky="NSEW")   
       

        # static center header
        headernew = tk.Button(self, bg='black',state=tk.DISABLED,justify=tk.CENTER, text="UA 571-C \n REMOTE SENTRY WEAPON SYSTEM", borderwidth=0, fg='yellow', disabledforeground='yellow')
        headernew.grid(row=0,column=1,columnspan=4,rowspan=2,sticky="NSEW")




        # displays gun id on top left and right of screen
        gun_1 = tk.Button(self, borderwidth=0,bg='black',fg='yellow',disabledforeground='yellow',state=tk.DISABLED,textvariable=self.gun, highlightcolor = 'yellow')
        gun_1.grid(row=0,column=0,rowspan=2,sticky="NS")
        gun_2 = tk.Button(self, borderwidth=0,bg='black',fg='yellow',disabledforeground='yellow',state=tk.DISABLED,textvariable=self.gun)
        gun_2.grid(row=0,column=5,rowspan=2,sticky="NS")


        # this quits by clicking a button labeled q
        quit = tk.Button(self, bg='black', fg='yellow', text='q', command=self.quit)
        quit.grid(row=8,column=0,sticky="SW")

        # these are the attachments for input from keyboard into the application
        # These are the button inputs from the original flash app that were used
        # I added a q as well to quit and close window in case there was a need to close

        self.bind("<KeyPress-f>", self.on_keypress_f)
        self.bind("<KeyRelease-f>", self.on_keyrelease_f)
        self.bind("<KeyPress-a>", self.on_keypress_a)
        self.bind("<KeyPress-b>", self.on_keypress_b)
        self.bind("<KeyPress-c>", self.on_keypress_c)
        self.bind("<KeyPress-d>", self.on_keypress_d)
        # These are the bind key definitions
        self.bind("<KeyPress-r>", self.on_keypress_r)
        self.bind("<KeyPress-q>", self.on_keypress_q)
        self.bind("<KeyPress-space>", self.on_keypress_space)
        self.bind("<KeyPress-k>", self.on_keypress_k)
       
    def coolbar(self):
        temperature_count = self.temperature.get()
        if temperature_count >= 21:
          temperature_count = self.temperature.get()
          temperature_count = temperature_count-1 or TEMP_INITIAL     
          self.temperature.set(temperature_count)
          self.after(300, self.coolbar)

    def overheat(self):
        rmcount_count = self.rmcount.get()
        rmcount_count = 0
        self.rmcount.set(rmcount_count)
        state_stat = self.stat.get()
        state_stat = "OVERHEAT"
        self.stat.set(state_stat)
        playsound("warning1.mp3")

    def critical(self):
        counter_value = self.counter.get()
        if counter_value <= 50:
          counter_value = self.counter.get()
          state_stat = self.stat.get()
          state_stat = "CRITICAL"
          self.stat.set(state_stat)
          playsound("warning1.mp3")
          counter_value = self.counter.get()         

    def out(self):
        counter_value = self.counter.get()
        if counter_value == 1:
          state_stat = self.stat.get()
          state_stat = "OUT"
          self.stat.set(state_stat)
          playsound("warning1.mp3")
          counter_value = self.counter.get()

    def reload(self):
        counter_value = self.counter.get()
        if counter_value >= 1:
          state_stat = self.stat.get()
          state_stat = ""
          self.stat.set(state_stat)
          counter_value = self.counter.get()

    # this defines the fire ammo count down sequence and resets
    def on_keypress_f(self, evet):       
        counter_value = self.counter.get()
        counter_value = counter_value-1 or INITIAL_COUNTER_VALUE
        self.counter.set(counter_value)
        counter_value = self.counter.get()
        # this is logic to try and get ammo warnings
        counter_value = self.counter.get()

        self.reload()
        self.critical()
        self.out()

 
        # this sets the time at 100%
        timer_value = self.timer.get()
        timer_value = timer_value-66 or INITIAL_TIMER_VALUE
        self.timer.set(timer_value)
        # this sets the rmbar to 40%
        rmcount_count = self.rmcount.get()
        rmcount_count = 40
        self.rmcount.set(rmcount_count)
        # this sets the temperature
        temperature_count =  self.temperature.get()
        temperature_count = temperature_count+1
        self.temperature.set(temperature_count)
        if temperature_count == 90:
          self.coolbar()
          self.overheat()
        else:
          state_stat = self.stat.get()
          state_stat = ""
          self.stat.set(state_stat)

    def on_keyrelease_f(self, evet):
        #this adds logic to say rate is zero if not firing
        #this automatically turns off rate bar moment key is released fixing a logic issue
        rmcount_count = self.rmcount.get()
        rmcount_count = 0
        self.rmcount.set(rmcount_count)
        temperature_count =  self.temperature.get()
        if temperature_count >= 20:
          self.coolbar()

# this launches the next screen, the fire select screen
    def on_button(self):
        secondframe = SecondFrame(self)
        self.withdraw()
        self.wait_window(secondframe)
        self.deiconify()
    def kudos(self):
        kudosframe = KudosFrame(self)
        self.withdraw()
        self.wait_window(kudosframe)
        self.deiconify()
    def on_keypress_k(self, evet):
        print("k pressed")
        self.kudos()
        playsound("click1.mp3")
# this reloads the game, you have to click it to make it the active window again
    def on_keypress_r(self, evet):
        self.destroy()
        self.create_splashframe
        playsound("click1.mp3")
# this launches you to window three, the fire select window
    def on_keypress_space(self, evet):
        print("space pressed")
        self.on_button()
        playsound("click1.mp3")
# this quits and closes the window by hitting a single key
    def on_keypress_q(self, evet):
        self.destroy()
        self.quit()
        playsound("click1.mp3")

    # this sets the gun terminal identification
    # this can also be expanded to do other things if you want to alter the script
    def on_keypress_a(self, evet):
        which_gun = self.gun.get()
        which_gun = "A"
        self.gun.set(which_gun)
        playsound("click1.mp3")
    def on_keypress_b(self, evet):
        which_gun = self.gun.get()
        which_gun = "B"
        self.gun.set(which_gun)
        playsound("click1.mp3")
    def on_keypress_c(self, evet):
        which_gun = self.gun.get()
        which_gun = "C"
        self.gun.set(which_gun)
        playsound("click1.mp3")
    def on_keypress_d(self, evet):
        which_gun = self.gun.get()
        which_gun = "D"
        self.gun.set(which_gun)
        playsound("click1.mp3")
   
#
#
# End fire menu class and related functions
#
#
#Begin secret credits(kudos) screen
#
#

class KudosFrame(tk.Toplevel):
    def __init__(self, *args, **kwargs):
        super().__init__(*args, **kwargs)
        self.geometry('512x256')
        self.title("Secret credits screen")
        self.focus_set()
        self.focus_force()
        tk.Grid.rowconfigure(self, 0, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 0, weight=1, uniform='a')
        tk.Grid.rowconfigure(self, 1, weight=1, uniform='a')
        tk.Grid.columnconfigure(self, 1, weight=1, uniform='a')

        r0c0 = tk.Button(self, text='Close', command=self.destroy, bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        r0c0.grid(row=0, column=0, sticky="NSEW")
        r1c0 = tk.Label(self, text ='Alienslegacy.com Credits \n knoxvilles_joker aka gabriel vos new script  \n martinr1000 font and some coding help \n MLR 2007 for original flash script \n Facebook.com  theuscm \n youtube.com/channel/UC4KYYScA5WcdCZeiU6lcjdA \n cobra_shipwreck channel aka knoxvilles_joker', bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        r1c0.grid(row=1, column=0, sticky="NSEW")
        r1c1 = tk.Label(self, text =' ', bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        r1c1.grid(row=1, column=1, sticky="NSEW")
        r0c1 = tk.Label(self, text ='Python-forum.io credits \n Yoriz coding pointers and help \n ndc85430 coding critique \n ', bg='black', fg='yellow',highlightbackground='yellow', highlightcolor='black', activebackground='yellow')
        r0c1.grid(row=0, column=1, sticky="NSEW")

        # These are the bind key definitions
        self.bind("<KeyPress-r>", self.on_keypress_r)
        self.bind("<KeyPress-space>", self.on_keypress_space)
        self.bind("<KeyPress-k>", self.on_keypress_k)
        self.bind("<KeyPress-q>", self.on_keypress_q)

    def on_button(self):
        secondframe = SecondFrame(self)
        self.withdraw()
        self.wait_window(secondframe)
        self.deiconify()
    def kudos(self):
        kudosframe = KudosFrame(self)
        self.withdraw()
        self.wait_window(kudosframe)
        self.deiconify()
# this reloads the game, you have to click it to make it the active window again
    def on_keypress_r(self, evet):
        self.destroy()         
        self.create_splashframe # this appears to launch the initial window       
    def on_keypress_r(self, evet):
        print("r pressed")       
        self.destroy()
  #      self.create_splashframe
        playsound("click1.mp3")
    def on_keypress_k(self, evet):
        print("k pressed")       
        self.kudos()
        playsound("click1.mp3")
# this launches you to window three, the fire select window
    def on_keypress_space(self, evet):
        print("space pressed")
        self.on_button()
        playsound("click1.mp3")
# this quits and closes the window by hitting a single key
    def on_keypress_q(self, evet):
        self.destroy()
        self.quit()
        playsound("click1.mp3")
#
# End secret credits(kudos) screen
#
#
#
# The below two commands run the entire script

tk_app = TkApp()
tk_app.mainloop()

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon Apr 26, 2021 5:33 pm 

Service Number: A05/TQ2.0.32141E1
Country: United States
I can get the canvas to draw, but I am researching how to get it to resize. Only other main issue is getting critical, out, and overheat logic to work. Overheat logic somewhat works.

_________________
The impossible takes a while longer and goes over budget too...


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 59 posts ]  Go to page Previous  1, 2, 3



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: