No boilerplate to lower the barrier of usage

7 views
Skip to first unread message

Facundo Batista

unread,
Oct 27, 2020, 7:12:47 AM10/27/20
to cocos-...@googlegroups.com
Hello!

I'll be working a little in building a small layer to reduce the
barrier of usage of people starting in the programming world and
trying to do games (for example, my son, <wink>).

This is after I did some analysis out there and found nothing really
suitable. For example, he started with PyGame Zero, but the second
thing he wanted to do was resize a sprite and it was a mess. Pilas
Engine is Python 2 only.

Cocos2d is fun, but it has some boilerplate that can be reduced if I
cut some corners (if he later wants those corners, he could go "full
cocos2d mode" :p).

This is an example of what I have so far:
http://linkode.org/#qUGZ2BUT60jqy436c5VJW1

I'm sure I will be sending other mails asking for stuff (sometimes
simple stuff, my cocos2d foo is rusty), but wanted to confirm some
assumptions:

- the best way to provide "audio" is through pygame internals,
`cocos.audio.pygame`.

- there is NO easy/simple way of adding physics (like, integrating
with Box2D or Chimpunk).

- collisions are supported by cocos2d but with "rectangles", no
polygons or "the no transparent part of a PNG with transparency".

Any light on those details, appreciated.

Thanks!

--
. Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org.ar/
Twitter: @facundobatista

claudio canepa

unread,
Oct 27, 2020, 10:39:05 AM10/27/20
to cocos2d discuss
Hi!

On Tue, Oct 27, 2020 at 8:12 AM Facundo Batista <facundo...@gmail.com> wrote:
I'm sure I will be sending other mails asking for stuff (sometimes
simple stuff, my cocos2d foo is rusty), but wanted to confirm some
assumptions:

- the best way to provide "audio" is through pygame internals,
`cocos.audio.pygame`.


Maybe. Relies on old ctypes bindings, probably assuming 32 bits binaries, and some distros ditched automatic 32bits support.
Needs testing 

The current pyglet relies on ffmpeg v4.x for audio.video, via ctypes over the shared libs

For windows and mac the package  pyglet-ffmpeg2, available from pypi provides the necessary binaries (not sure if on latest mac)

In Linux / debianites, if ffmpeg not included  maybe 'apt-get ffmpeg' would suffice (the related pyglet doc section is a bit too generic to tell, https://pyglet.readthedocs.io/en/latest/programming_guide/media.html#ffmpeg-installation ) . Maybe you could ask in the pyglet about installation experience and details.  
 
- there is NO easy/simple way of adding physics (like, integrating
with Box2D or Chimpunk).


For your target (' reduce the barrier of usage'): No.
Barriers are:
 - binaries distribution
 - per-case tweaking the simulation to not do silly things 
 
- collisions are supported by cocos2d but with "rectangles", no
polygons or "the no transparent part of a PNG with transparency".


Axis Aligned Rectangles or circles, no pixel perfect collision detection. 
 
Any light on those details, appreciated.

Thanks!


You are wellcome

A project that aims in that direction is pyarcade
  - pyarcade  https://arcade.academy


--
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org.ar/
Twitter: @facundobatista

--
You received this message because you are subscribed to the Google Groups "cocos2d discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cocos-discus...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cocos-discuss/CAM09pzSub8WLMMA3v7977vhONW3FHye3ko1sj5VKT_L7Jko9QA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages