Forums

ForumsProgramming Forum

My AS3 progress :D

Posted Jul 12, '11 at 11:29am

Carlytoon

Carlytoon

329 posts

Hi
I wanna show you my progress in the game programming in AS3, I have a blog where I show my progress and the SFW (flash movie) proving my progress.
Here is the blog (sorry is in spanish):
http://miprogramacionenas3.blogspot.com/

Well, i really want constructive commnents, you can do the comments here or in the blog. I really want a review of my knowledge in the AS3, you can tell me if I have a poor knowledge or a little good knowledge.

 

Posted Jul 12, '11 at 2:05pm

elshobokshy

elshobokshy

161 posts

Cool cursor :D

 

Posted Jul 12, '11 at 2:11pm

elshobokshy

elshobokshy

161 posts

So the first one is you move with the mouse and press buttons from 1-9 to change speed and 0 makes it stop, amazing!
The second one is like a spaceship, when you click it fires haha :D
The third one you move the arrow keys and when you try to get it out of the screen you can't.

That's great good job! If you give it some more effort you can make a game ;)

 

Posted Jul 12, '11 at 2:38pm

PrideRage

PrideRage

152 posts

¡Hola Carlytoon!
Tú blog es interesante :)
Tienes un SWF en viernes 8 de julio de 2011 que me encanta mucho.
¿Cómo puedes generar varios pelotas simultáneamente?
¡Supongo que puedes ayudarme! :D
Saludos, PrideRage

 

Posted Jul 12, '11 at 2:42pm

PrideRage

PrideRage

152 posts

Lo siento por el problema :(
Ahora es correctamente:

Hola Carlytoon!
Tu blog es interesante :)
Tienes un SWF en viernes 8 de julio de 2011 que me encanta mucho.
Como puedes generar varios pelotas simultaneamente?
Supongo que puedes ayudarme! :D
Saludos, PrideRage

 

Posted Jul 12, '11 at 3:51pm

elshobokshy

elshobokshy

161 posts

Please speak English.

 

Posted Jul 12, '11 at 4:08pm

acmed

acmed

3,561 posts

@elshobokshy, here's english:

Carlytoon Hello!
Your blog is interesting:)
Got a SWF on Friday July 8, 2011 I love a lot.
As you can generate several balls simultaneously?
I guess you can help! : D
Greetings, PrideRage

Anyways, is there a concept in that? I don't really get it.

 

Posted Jul 12, '11 at 4:11pm

Carlytoon

Carlytoon

329 posts

Como puedes generar varios pelotas simultaneamente?

Para crear varias pelotas simultaneamente debemos de crear una clase (una funcion que puedes asignar a distintas instancias para que se comporten igual que la clase) por medio de un paquete (un pedazo de codigo que puedes ejecutar), por ejemplo:
Creamos un paquete y ponemos esto, analizalo bien y no olvides guardarlo como ball:

package{//vamos a usar un paquete
import flash.display.Sprite;
//importamos el display de flash para mostrar un Sprite
//usamos Sprite porque necesitamos mostrar los graficos
import flash.events.Event;
// importamos los eventos de flash y usaremos Event
public class ball extends Sprite{//publicaremos la clase para poder accader a ella externamente
public function ball(){//usamos una funcion porque vamos a ejecutar algo
addEventListener(Event.ADDED_TO_STAGE,crear);
//Llamaremos a la funcion "crear" cuando añadimos a ball en el Stage
}
public function crear(e:Event){
//A continuacion dibujaremos la pelota
graphics.beginFill(0x000000);
graphics.drawCircle(0,0,4);
graphics.endFill();

removeEventListener(Event.ADDED_TO_STAGE,crear);//Removemos el EventListener porque ya no usaremos
}
}
}


Luego en las acciones de en un nuevo archivo de AS3 pones esto, analizalo y no olvides guardarlo:

stage.addEventListener(MouseEvent.MOUSE_DOWN,Mouse_click);
//Llamamos a la funcion "Mouse_click" cada vez que hacemos click sobre el "stage"


function Mouse_click(e:MouseEvent){//Definimos la funcion "Mouse_click"
var pelota:ball=new ball;//Creamos una "pelota" de tipo "ball" cada vez que se ejecuta Mouse_click

//Ubicamos la nueva pelota en el mouse
pelota.x=mouseX;
pelota.y=mouseY;

addChild(pelota);//Añadimos "pelota" al "stage"
}

Como puedes ver, puedes crear distintas pelotas haciendo click, pero lo puedes modificar y puedes hacer que se creen pulsando una tecla del teclado o usando distintas condiciones para que se cree. Espero que esto ayude y si tienes alguna duda dimelo :)
 

Posted Jul 13, '11 at 12:19am

Darkroot

Darkroot

2,879 posts

I'm pretty sure it's been said by moderators a dozen times, this is an English site so speak English.

Otherwise your stuff looks nice but it's impossible to say if you just copied it off somewhere else but you got some basic drawing API in there and OOP concepts. But it really does look like script you took of anywhere else on the internet. If you didn't then you wouldn't need to ask about if what you know is good enough, beginners usually ask that, not people who know basic-expert as3. So it just looks like your a beginner that is taking apart other peoples code.

 

Posted Jul 13, '11 at 2:31am

Carlytoon

Carlytoon

329 posts

I'm pretty sure it's been said by moderators a dozen times, this is an English site so speak English.

Sorry about that :3

Otherwise your stuff looks nice but it's impossible to say if you just copied it off somewhere else but you got some basic drawing API in there and OOP concepts. But it really does look like script you took of anywhere else on the internet.

Believe me, all the code was by myself, and you have reason that code looks like a anywhere else on the internet script, but this code was made by me, I just know how to do some code :)

If you didn't then you wouldn't need to ask about if what you know is good enough, beginners usually ask that, not people who know basic-expert as3.

Well, i dont consider myself a expert in as3, Im just a beginner that try to be a expert, and I dont consider wrong the idea of asking about my progress to another person :D

So it just looks like your a beginner that is taking apart other peoples code.

Well, sometimes, I analyze other people code to understand how they code works and how the AS3 works too, but thanks to that I can do my own code and put my ideas in the script ^-^
 
Reply to My AS3 progress :D

You must be logged in to post a reply!