This topic contains 10 replies, has 2 voices, and was last updated by BobC Jul 1-10:01 am.
June 9, 2018 at 6:25 am #10801Member
Its sad that I like that dumb game so much that I keep installing it even though it takes a huge amount of space to drag in a mountain of KDE stuff, but its just that that is the only KDE app that I like enough to do it for.
I think I will try to recreate it in Python somehow. Its about time I learned the object oriented programming stuff, and the only way to learn it is to do something with it…
June 9, 2018 at 1:15 pm #10808Member
- This topic was modified 1 year, 4 months ago by BobC.
a game program can be tiny, like 100kb or less.
Snake sprite can be displayed as ascii characters in terminal, or with ncurses ui, or it can have fancier ui based on pygame.
For the dueling (against an opponent) feature, might need to checkout games-n-tutorials titled “tron”, not “snake”.
Anyhow, here are some leads
many ready to run variations of the snakegame https://www.pygame.org/tags/snakeJune 9, 2018 at 4:02 pm #10810Member
As always you seem to be treasure chest of knowledge willing to share, and I do appreciate it. If I find it already written I’ll figure it out enough to tweak and tune it, so I learn how it works.
I always learn mmore when its creating something I’d like to have…June 14, 2018 at 10:08 pm #10909Member
I am thinking of trying a 2048 game too. It seems to me that the snake game maybe could be modified to add an AI second player.
I see pygame is 6 mb, so that explains why its not included in AntiX.
Do you think I will be able to do it from scratch with tkinter (takes less than 100k) and without pygame or should I just bite the bullet and install pygame?June 15, 2018 at 12:42 am #10910Member
Because tk.canvas lacks reasonable antialiasing, I am not a fan of tkinter.
If you go that route (mebbe okay for squarish sprites, stuff like tetris) take a look at the pygubu tool for rapid UI creation.
pygame (python-pygame) (AND probably python-pygame-sdl2)
wow, better budget quite a lot more drive space, given the dependencies. The numerical python (numpy) library, that alone will be 12mb or so.
When you run apt-get install, examine the details at the Y/n “proceed?” prompt. Well over 20mb new package will be installed, right?
pygame has a rich selection of tutorials and decades worth of prior art available as examples to reverse engineer and active support community. You will have a blast!June 16, 2018 at 9:52 pm #10936Member
My knowledge level is insufficient with python itself, so even though the basic stuff is TOO basic, I’m just going to start with python itself until I can understand the syntax, terminology and objects and their usage. I tried some pygames and tkinter ones, and they assume I already know and understand those things, but I don’t. If there is a difficulty, its that my brain is tired from work, so my attention span is too short to be able to make progress as quick as I’d like.
I’d rather really understand it, not just be able to tweak. I can always fall back to there if I have to. It would be cool to be able to tweak a few small games and get them to work and make them easy to install. It might be more than I’m able to do at present, but it would be a good goal.
I’ll have to look at pygubu… Thanks for the suggestions.June 24, 2018 at 5:35 am #11080Member
Am I learning the wrong language?
If everyone else is putting all their development effort into “phone apps”, should I be putting this time into learning that instead?
But if that’s true, and let’s say I created ad-free android apps, forgive my ignorance, but are those different from java?
How would I develop and run them on AntiX, hopefully without needing to load tons of other “stuff”?June 24, 2018 at 1:43 pm #11089Member
can’t see spending much attention worrying about what “everyone else” is doing, but hey suit yourself.
“say I created ad-free android apps”
I don’t use android so don’t give a hoot about that platform, but more than just a few android apps are written in python.
When an app gets built for, packaged for, android yeah it’s likely to be automatically converted to java bytecode along the way. Automatically, but your program would need to incorporate qpython or kivy components…
“How would I develop and run them on AntiX, hopefully without needing to load tons of other stuff?”
Them? It ain’t quite like that. You write a program on whatever platform then build/package/test on whatever other targets you also wish to support.
As an example, let’s consider PySol (solitaire card game, written in python)(includes hundreds of playable solitaire variants)
development ceased in 2003
Note that pysol.org website is still available, and advises that it has been superceded by “PySol Fan Club edition” (and contains a link to pysolfc.sourceforge.net)
PySol was originated by Markus F.X.J. Oberhumer in 1998. It is written in the Python programming language, and it uses the Tk GUI toolkit. While development of the original PySol officially ceased in 2004, several forks, including PySolitaire, UltraSol, FlowerSol, and PySol Fan Club Edition (also known as “PySolFC”) continue to be developed by the game’s community.
PySolFC was noted by several news outlets positively as a “tremendous collection of Solitaire games, going well beyond the usual mix” and was downloaded from Sourceforge alone 290,000 times between 2006 and May 2017. PySolFC is also included in many Linux distributions like Ubuntu, Fedora, OpenSuse, Debian, and also ported to other platforms such as Microsoft Windows, Mac…
In December 2000 CNN placed PySol among the “Top 10 Linux games for the holidays”. PySol received in 2003 The Linux Game Tome’s Best Free Cards/Board/Gambling Game award.
2014, “it” wound up added to google play store https://play.google.com/store/apps/details?id=org.zyb.pysolfc&hl=en_US
and was NOT well received. Read the user reviews about ads, and missing features, and bugginess
and the response by the 2014 apk uploader (in this context, seems wrong to describe the person who uploaded the app as the PySol _author_)
“There are a few reasons why this is the minus to PySolFC. The fundamental one is the underlying framework used by PySolFC is not fit for Android, I had to build that for Android, but sorry it seems not perfectly done.”
Oct 2017 “it” was packaged for and added to F-Droid collection, and cites pysolfc.sourceforge.net as project homepage)
“A new user interface has been developed using the kivy framework to meet requirements of touch screens devices.”
the F-Droid request for packaging page cites “Source Code: bitbucket.org/lufebe16/pysolfc” (contains code that was LastUpdated in Feb 2018)
http://pysolfc.sourceforge.net/ This is, and has been (as linked from pysol.org, back in 2003) the official homepage for the project.
And on this page we find “Source repository on GitHub: github.com/shlomif/PySolFC”
(this github project repository was created April 2017)
READ the shlomif/PySolFC project page at gihub and note that (on your antiX O/S) you can simply:
1) download the project code
2) install the libraries it depends on
sudo apt-get install -y ack-grep cpanminus libperl-dev make perl python-glade2 python-gnome2 python-gnome2-dev python-gtk2 python-setuptools python-tk
3) cd into the source directory and “python pysol.py”
or you could, and perhaps pereceived as “even more simply” apt-get install pysolfc
The packaged-for-debian version (pysolfc v2.0-4) is dated Apr 2016 and (so) lacks the integrated Kivy touch-friendly UI bits.
If you wanted to use Kivy (for pysol or other app) debian does have packaged versions available
but, again, those packages are dated 2016
You might check reverse depends, to find what all debian packages depend on those Kivy packages.
Probably very few do, because touch functionality is not (at least not yet) a priority for programs packaged for use on desktop debian target.June 24, 2018 at 2:18 pm #11090Member
Your takeaway from that example may be different from mine. Here’s my assessment (and I don’t claim this is absolutely correct):
If your python program, your “it”, is intended to support touch/mobile usage, you probably want the (not from debian) up-to-date version of the kivy libraries. If “it” does use those, and is packaged for use on debian/antiX, the “dragging in all sorts of extra stuff” must include re-packaging and redistributing those kivy libraries or creating a setup mechnism which demands python pip as a prerequisite, retrieving the libraries from the web as needed (yuk, as a potential user, pip is a showstopper. Like, if i was inclined to trust and use unvetted PPAs, i should be using ubuntu. or maybe archlinux + AUR). The status quo probably can’t change until someone interested (and blessed by debian bureaucracy) steps up, decides to maintain up-to-date debian packages for kivy. Instead, within debian ecosphere I’m noticing attention toward touch-enabled apps that utilize/depend DE-proprietary libraries.June 24, 2018 at 11:39 pm #11094Member
Thanks for the amount of research there! Your choice of basic subject example, ie Pysol, is perfect, as its a set of games I’m familiar with, at least from a standpoint of installing and playing on AntiX and other Linux distro’s.
The big thing I read there is that Python is not likely to be a dead end street next month or next year, and so my efforts won’t be a waste if I figure it out. I’m at video 60 out of 156, and haven’t seen an import statement yet, and still don’t know what classes, attributes and methods are available in any of these libraries or how to find out, let alone make use of them or change things that do.
My problem is the objects. I first learned to code in 1972, so my mind sees code as a sequence of input, process, and output, with straight lines and decisions determining the paths, and that takes a very different mentality. I did learn the object “stuff” back in the very early 90’s but the project died because the system was just too slow and hooked to a pre Y2K system that got replaced, and I never had demand to go back to an object oriented language after that, because everyone always wanted other things.
I think I’m just going to keep plugging away at the Python direction I started, tweaking a simple python GUI game, and getting to where I have a simple snake, then me vs the computer snake/tron like game that doesn’t take a lot of dependencies to install, and possibly using a tic-tac-toe or 2048 game, whatever looks simplest, to use as a learning step to get there if I need to.
Thanks for showing me it can still be useful beyond getting my games for the price of some effort…July 1, 2018 at 10:01 am #11195Member
Never made it through the object stuff. I found “missing links”, that might help me get back on track, though. They have snake, tron and pacman.
Minimal additional dependencies… On top of AntiX 17 full I needed to install:
Installing Free Python Games is simple with pip:
$ python3 -m pip install freegames
Free Python Games supports a command-line interface (CLI). Help for the CLI is available using:
$ python3 -m freegames –help
The CLI supports three commands: list, copy, and show. For a list of all games run:
$ python3 -m freegames list
Any of the listed games may be played by executing the Python module from the command-line. To reference the Python module, combine “freegames” with the name of the game. For example, to play the “snake” game run:
$ python3 -m freegames.snake
Games can be modified by copying their source code. The copy command will create a Python file in your local directory which you can edit. For example, to copy and play the “snake” game run:
$ python3 -m freegames copy snake
$ python3 snake.py
Python includes a built-in text editor named IDLE which can also execute Python code. To launch the editor and make changes to the “snake” game run:
$ python3 -m idlelib.idle snake.py
You can also access documentation in the interpreter with Python’s built-in help function:
>>> import freegames
- This reply was modified 1 year, 3 months ago by BobC.
You must be logged in to reply to this topic.