Posted: 18th Feb 2024 20:28
Good evening a couple of years ago I looked at this and thought this looks far too complicated . I took another look a couple of weeks ago and this time I decided to put in some effort. Glad I did as once I realized what all the under scores were for it was just like regular AGK. I would like to use Python as a stepping stone for Mojo and I'm hoping AppGameKit will work with Mojo as python does. We'll see I suppose. Print_value_screenFPS does not appear to work but so far everything else does .
Any advice or input appreciated . Enjoy your evening.
Posted: 19th Feb 2024 4:15
Would you please paste your code here (at least the part that's not functioning)?
Posted: 20th Feb 2024 10:51
+ Code Snippet
import appgamekit as agk
with agk.Application():
    agk.set_clear_color(150, 0, 150)
    agk.set_window_size(1280, 720, 0)
    agk.set_virtual_resolution(1280, 720)
   # agk.set_sync_rate(60, 0)
    agk.set_vsync(-1)
    jump1 = agk.create_text("Hello World")

    a = 2
    x = 1
    pbc = 90
    while a > 1:
        pbc = pbc + 1
        x = x + 1
        if x > 1280:
            x = -600
        if pbc > 254:
            pbc = 1
        agk.set_clear_color(0, 100, 0)
        agk.delete_text(jump1)
        # agk.sync()
        jump1 = agk.create_text("Hello World")
        agk.set_text_size(jump1, 90)
        agk.set_text_position(jump1, x, 350)
        agk.set_text_color(jump1, 100, 0, 50, 255)
        agk.set_text_visible(jump1, 1)
        agk.print_value("FPS = "  + str ScreenFPS())
        agk.sync()
        if agk.get_raw_key_state(27):
            break
        if not agk.get_raw_key_state(27):
            continue


Hey Adam it is the screenFPS that I can not get to work. I have played with the code a fair bit so . with the screenfps line removed It did run .
Posted: 20th Feb 2024 10:55
This is the way I intend to continue. could you please point me in the right direction.
Thanks for reading .
Posted: 20th Feb 2024 13:13
Hi Adam really enjoying using AppGameKit with python. The only thing I don't like is there is no goto officially . But apparently it can be done. I've tried a few things to cure this and am still looking at it. Thanks Adam .

+ Code Snippet
agk.print_value(agk.screen_fps())


the code above does do what it says on the tin and works great. screen fps works fine it was my mistake.

I get paid in a couple of weeks and I will make a donation then.
Posted: 20th Feb 2024 13:46
Hey Adam it is now working .
+ Code Snippet
 (agk.print_value(agk.screen_fps())


This is great thanks.
Posted: 21st Feb 2024 1:07
Good evening . How do I write a program in Python with AppGameKit . I've had some good results so far but I don't understand how to use it without the goto command .
I guess I'm gonna have to do some serious reading . Something I have noticed is Python with AppGameKit is faster than I thought it would be. The last time I tried to use python was on a very rubbish laptop without AppGameKit and it was the fact it was just not a powerful enough computer to run things properly ( HP Stream ) . Does anybody know which is faster AppGameKit tier 1 or AppGameKit for python ? With mojo just around the corner I think this is the way to go . I'm still using tier 1 AppGameKit but my next project will be Python / AppGameKit . If I can work out how to program without goto . I can make a loop which is good . I figure that a way to do this is make everything a function and then call each one as needed , sort of gosub return. Thanks for reading and any input or advice appreciated.
Posted: 21st Feb 2024 14:50
You found the problem before I logged in again. Yes, it was the "str ScreenFPS()" part. It can also be: agk.print_value(f"FPS = {agk.screen_fps()}")

The speed comparison between tier 1 and AppGameKit for Python is very close.

Bear in mind that AppGameKit for Python has some limitations at the moment:
* doesn't run on Android, iOS, or Mac
* distribution is limited on Linux.
PyInstaller can be used to make standalone Windows executables, though.

In the future, discussions specific to AppGameKit for Python might be better done at itch.io.

A lot of the code you have in your loop should be outside of your loop:
+ Code Snippet
        agk.set_clear_color(0, 100, 0)
        agk.delete_text(jump1)

        jump1 = agk.create_text("Hello World")
        agk.set_text_size(jump1, 90)
        # snip
        agk.set_text_color(jump1, 100, 0, 50, 255)
        agk.set_text_visible(jump1, 1)

No need to delete jump1 and recreate it. The rest of these lines are set up code that can be above the while loop. That would go for the Tier 1 code as well.
Posted: 22nd Feb 2024 12:31
I think switching to Python from Tier 1 is gonna be pretty seamless. When I first looked at this a couple of years ago I thought it would be too difficult but it is really nice to work with and knowing AppGameKit is a major step up from the start.
Posted: 23rd Feb 2024 8:07
Yes I see as in limitations. Still very nice.
Posted: 23rd Feb 2024 11:43
I'll take a look at pyinstaller shortly and we'll see what happens. Of coarse there is tier 2 but I don't want to go down that path. At the moment I'm trying to get into Python as a stepping stone for Mojo and I am hoping AppGameKit Python will work.
Posted: 5th Mar 2024 16:33
Adam, how could I export games as an apk i made with AppGameKit for Python?
Posted: 6th Mar 2024 3:08
There is currently no way to export for Android with AppGameKit for Python.
I would like to find one, but haven't yet.
Posted: 6th Mar 2024 13:48
How about as an executable file for Windows? Do you have tutorials for It?
Posted: 7th Mar 2024 14:39
Look at "appgamekit-pyinstaller-spec-example.zip" at https://fascimania.itch.io/appgamekit-for-python.
It uses PyInstaller to create an folder with all of the files for distributing on Windows, including an EXE.
Posted: 10th Apr 2024 17:50
Hey, any updates in appgamekit with Python? And for instance, can i use machine learning with this?
Posted: 11th Apr 2024 3:42
Last I checked the AppGameKit repo was being rebuilt and I would have to adapt my build process to accommodate it. There weren't any changes to AppGameKit lately that would have affected the Python version.
I haven't done anything with machine learning and this project.