Video tutorial on how to install cocos2d ubuntu.

457 views
Skip to first unread message

Jon

unread,
Jul 21, 2011, 6:31:01 AM7/21/11
to cocos-...@googlegroups.com
Not the iphone version.

Facundo Batista

unread,
Jul 21, 2011, 8:39:59 AM7/21/11
to cocos-...@googlegroups.com
On Thu, Jul 21, 2011 at 7:31 AM, Jon <noveltye...@gmail.com> wrote:

> Not the iphone version.

You're *searching* for a video?

--
.    Facundo

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

Novelty Engine

unread,
Jul 21, 2011, 9:47:19 AM7/21/11
to cocos2d discuss


There is no video for the non-Iphone version you know the one for
making games on your pc for ubuntu. If someone would make a tutorial
on cocos2d doc section it would be nice.

Joseph Marlin

unread,
Jul 21, 2011, 10:32:55 AM7/21/11
to cocos-...@googlegroups.com
All you really should need to do is 'sudo easy_install cocos2d'. You can install easy_install if you don't have it with 'sudo apt-get install python-setuptools' I believe.

Novelty Engine

unread,
Jul 21, 2011, 12:35:12 PM7/21/11
to cocos2d discuss
It is installed how do I run it with eclipse and will rabbyt,pygame
and box2d work with it. What python frameworks, libraries program do
you recommend running it with.

Joseph Marlin

unread,
Jul 21, 2011, 1:44:04 PM7/21/11
to cocos-...@googlegroups.com
I run it by itself, although I might pull in kytten too if it isn't too hard... I might just roll my own GUI too though. Anyway, point is, to run it, all you need to do is "import cocos2d" at the top of any modules that will use it. Check the examples included in the download on the Cocos2D site. 

I would not run pygame with cocos2d. They'd conflict a lot, I would imagine, as they have similar aims. You probably *could* use rabbyt, but Cocos has fantastic sprite work, so I doubt you'd need it. Box2D, depends on what you are doing I suppose.

Disclaimer: I'm super new at this. I have no idea what I'm doing with this library, but I like it. =]

Novelty Engine

unread,
Jul 21, 2011, 3:28:30 PM7/21/11
to cocos2d discuss

imageshack. us/photo/my-images/88/pydevcocos2dsrccocos2d0.png/ Here is
how I set it up in eclipse. I pasted the flag3d one into Coco2d
game.py. Here are my errors.
Description Resource Path Location Type
Invalid name for Python module: Coco2d game (it'll not be analyzed)
Coco2d game.py /Cocos2D/src/cocos2d-0.4.0 line 0 Invalid python file
marker

File "/usr/lib/pymodules/python2.7/pyglet/resource.py", line 436, in
_alloc_image
file = self.file(name)

File "/usr/lib/pymodules/python2.7/pyglet/resource.py", line 394, in
file
raise ResourceNotFoundException(name)
pyglet.resource.ResourceNotFoundException: Resource "flag.png" was not
found on the path. Ensure that the filename has the correct
captialisation.

Should I take all the files from the folder and paste them in the src.

Joseph Marlin

unread,
Jul 21, 2011, 3:36:05 PM7/21/11
to cocos-...@googlegroups.com
Did you read your errors? They tell you all you need to know!

1) "Invalid name for Python module: Coco2d game" 

Look into how to name Python modules for this one.

2) "Resource "flag.png" was not found on the path."

Self-explanatory. Make sure your path to this file is correct. 


Novelty Engine

unread,
Jul 21, 2011, 5:07:05 PM7/21/11
to cocos2d discuss


I have a problem I can't seem to run it properly in eclipse. Can
anyone help me run it in eclipse.

Novelty Engine

unread,
Jul 23, 2011, 12:46:32 PM7/23/11
to cocos2d discuss
How do I run it in eclipse.

claudio canepa

unread,
Jul 23, 2011, 1:51:21 PM7/23/11
to cocos-...@googlegroups.com
Generally they are problems running games from an IDE because the game  event loop fights with the IDE event loop, or the game cannot obtain the proper window access due to how the IDE runs a script.

Sometimes the IDE allows to customize how it will run a script, and one of the settings can work for a game, but that is specific to the IDE .

So your options are:
    . wait to see if some cocos user is an Eclipse user and can give a hint (but I think few people, if any,  uses Eclipse + Python + cocos)

    . look the Eclipse documentation to see if the run command can be customized, and try variants to see if anything work.

    . most usual and safe: run the game from an OS console

--
claudio
 

Novelty Engine

unread,
Jul 24, 2011, 4:59:56 PM7/24/11
to cocos2d discuss
Summited to eclipse forum did anyone try to run it in eclipse.

On Jul 24, 3:51 am, claudio canepa <ccanep...@gmail.com> wrote:
> On Sat, Jul 23, 2011 at 1:46 PM, Novelty Engine
> <noveltyengine...@gmail.com>wrote:

Novelty Engine

unread,
Jul 26, 2011, 1:01:48 AM7/26/11
to cocos2d discuss
Okay how do I run it with out ecipse. How do you normally run it. I
have installed it but can someone make a video on how to install and
run it.


Thomas A R Woelz

unread,
Jul 26, 2011, 2:28:02 AM7/26/11
to cocos-...@googlegroups.com
That is a strange question. I don't see a need for a video. You need first to install Python (get it from python.org), then pyglet (pyglet.org) then cocos2d (cocos2d.org) then read their programming guides, and run your script directly. Any "whatever.py" file you can just double click it will run (if on Windows and Python is installed). If not, go to command line (or terminal) and type:
python whatever.py
(whatever.py of course should be the name of your script)
All the info you need are on each of those websites. And of course, if you aren't much familiar with programming in Python, there are great resources (tutorials, etc) at http://wiki.python.org/moin/BeginnersGuide
Good luck

Novelty Engine

unread,
Jul 27, 2011, 9:07:13 PM7/27/11
to cocos2d discuss
I have installed everything can someone through pictures show me how
to run cocos2d or through a video there needs to be a video.

claudio canepa

unread,
Jul 28, 2011, 12:46:59 AM7/28/11
to cocos-...@googlegroups.com
On Wed, Jul 27, 2011 at 10:07 PM, Novelty Engine <noveltye...@gmail.com> wrote:
I have installed everything can someone through pictures show me how 
to run cocos2d or through a video there needs to be a video.


I think there is a certain confusion there: cocos is not an application to graphically make games; it is a bunch of text files containing python code, to be used by python programmers  to write games.

--
claudio
 

Novelty Engine

unread,
Jul 28, 2011, 1:56:16 AM7/28/11
to cocos2d discuss

In video tutorial 2 they are moving sprites in real time. How do I use
cocos2d please give video or pictures. It isn't that hard.

Thomas A R Woelz

unread,
Jul 28, 2011, 4:25:15 AM7/28/11
to cocos-...@googlegroups.com
There you go, you have seen the tutorials in video. Thats all there is in terms of video. The rest are the programming guides you find on both cocos2d site and pyglet. 
The tutorials show the use of the interpreter that comes built in the cocos2d director. If you run any cocos2d script you can access the interpreter with control-i. From that prompt you can add nodes (sprites, etc) and run actions on them. I don't see much use for that, its more for demonstrations and stuff like that. Just like using the python prompt. Maybe good for learning and for fun. Most of the time you will want to code the layers and scenes before running it, so its there already - no need for that interpreter. And there is no "real time" way to do that, or any visual tools for that matter, just open your Python-aware text editor (seems you are familiar with eclipse, so get PyDev) and hack away.
You can learn a lot by looking inside the tests and demos you get from downloading the source codes from the google code repositories. Both cocos2d and pyglet have tons of tests and example games around for you to study. Now please stop asking for videos, its getting old already. Thanks
 

Novelty Engine

unread,
Jul 28, 2011, 4:02:44 PM7/28/11
to cocos2d discuss
It ain't working.

import sys
import os
sys.path.insert(0, /home/family/Downloads/Programming/cocos2d-0.4.0)


import pyglet
from pyglet.gl import *
import cocos
from cocos.director import director
from cocos.euclid import Point2,Point3
import math



Description Resource Path Location Type
Unresolved import: cocos COCO.py /COCOS2D/src line 7 PyDev Problem
Unresolved import: director COCO.py /COCOS2D/src line 8 PyDev Problem
Unresolved import: Point2 COCO.py /COCOS2D/src line 9 PyDev Problem
Unresolved import: Point3 COCO.py /COCOS2D/src line 9 PyDev Problem

Thomas A R Woelz

unread,
Jul 28, 2011, 7:52:45 PM7/28/11
to cocos-...@googlegroups.com
Is that the whole script? No mainloop, nothing? That won't do anything of course.
About the PyDev problems, they are problems to ask about on a PyDev forum, not here. Most people here are probably not PyDev users and don't care about this platform.
I happen to use it, so I think I know what may be wrong there. Seems you either didn't install the libraries, or didn't setup the correct interpreter on PyDev, or if you did the PyDev interpreter PYTHONPATH does not include the correct folders. If you want to use local imports, pyglet and cocos don't have to be installed, but you need to setup your project's PyDev PYTHONPATH to include the source folders with those modules.
Eclipse + PyDev is not the most user-friendly platform to use if you are not familiar with them, takes a while getting used to. Make sure you read this: http://pydev.org/manual_101_root.html as it covers the whole issue of setting up paths etc. There are more instructions at http://pydev.org/manual.html
If that is not enough, make sure you ask stuff about PyDev errors and problems at the PyDev User Forum (http://sourceforge.net/projects/pydev/forums/forum/293649), not here, as this forum should cover cocos2d issues, not PyDev's.
Good luck,
Thomas
Reply all
Reply to author
Forward
0 new messages