I buy some 2d vectors , backgrounds , enemies , heroes and platforms.
i make already a game for android with adobe cs5.5 but i have some lag and gravity issues.
So, i decide to make it again from the start using starling.
The way i draw my game is simple.I like to have my enemies , coins etc to the stage and not dynamically add them.
So , is there a good tutorial for me to explain gravity , hit collision with ground and enemies?
Also i would like to know if writing a code in timeline or in classes is better or its not a big deal if the code is good written.
Thanks!
Related
I start before 1 year to use CS6 and I found some tutorials that explain how to make pltaformer games, I try a lot of tutorials they work great but for the code they use the timeline.
So, I make a game using the timeline but when I published it and running to my android device I have a lot of lag issues.
After a research I realized that coding in the timeline is a bad idea, also it's better to use Starling for making apps for mobile devices.
So I want to start again to learn how classes working.
I make a new project and I have 5 classes (Main, Level1, Hero, Ground and Enemy). I want the hero to interact with Ground (for gravity) and with Enemy (for hitTest), also Enemy have gravity so they must interact with the Ground.
The concerns are :
In which class I must write the hitTest function?
I have to write in Ground class the hitTest for Hero and the Enemy and in the Hero class to write the collision between the Hero and the Enemy
Or all of this functions must be write in Main class?
I am using flash cs6 and making a game in which some squares are falling down randomly and we have a wall that is controlled by the mouse. Every square we dodge 10 points are added to the score. If the squares touch the wall then we go to another scene called the "the end" scene in this scene we display the score to the player. So I want to pass the score variable to that scene. I have tried googling it a lot of times but it couldn't help. So my only hope is you guys. Please help.
How do I go to the next scene:
if (wall.hitTestObject(square))
{
gotoAndStop(1, "The End");
}
Instead of using flash to create games like this you can Game Maker it is more efficient.
You can go to its website yoyogames.com
Adobe Flash Professional Creative Suit series are for designers, animators. It is one of the worst IDEs for a programmer (notepad would be better). I'd suggest you to get a better IDE like Adobe's Flash Builder which is more suitable for programmers or search for other 3rd party IDEs like IntelliJ Idea which is one of the best from my point of view.
Instead of programming on timeline and using scenes which is for animators, get into the Object Oriented Programming, start with the basics, the classes, then move on with design patterns etc.
I would like to create a multiplayer billiards game with flash actionscript 3 but I don't know how.
If some tutorials exist for this I'd like to read them.
where should I begin ?
The kind of tutorial you are looking for is very specific and so far I haven't been able to find a tutorial about that. However, there are some tutorials about making a billiards game in Flash ( http://www.youtube.com/watch?v=Kh_CWDeQcj0 for an example) and there are also tutorials about making a multiplayer game in Flash. Try and see if you combine a tutorial about making a billiards game and about making a multiplayer game.
If you're experienced with Flash/AS3 you could also try integrating a 3D library like Away3D, like the author of this game did: http://away3d.com/showcase/detail/penthouse_pool_3d .
I want to create a game where you shoot a rocket into the ground (Sand) and it blows, and moves the sand to the sides...
Is it possible in Box2D? breakable little objects?
It's almost pixel perfect collusion detection.
Thanks!
Yes it's possible, but beware your performance is going to be pretty weak. See the following articles (sorry guys, I normally like to paste in code instead of just link but there is are too much of it).
http://www.emanueleferonato.com/2012/01/17/create-real-explosions-with-box2d-adding-textures/
http://www.emanueleferonato.com/2012/01/05/create-real-explosions-with-box2d-exploding-objects-and-setting-the-center-of-explosion-with-mouse-click/
http://www.emanueleferonato.com/2011/12/08/create-real-explosions-with-box2d/
As far as dirt flying out when the ground breaks, the dirt doesn't have to be physical, you can just fake that with some particle effects. (Lots of tutorials on those things here)
In box2d it's not possible to break an object other than to remove the old one and create many new objects. If you need almost pixel perfect collision detection you'd need lots of objects. A 100x100 square contains 10 000 pixels.
A year ago I created a physical simulation involving many small particle-like objects using box2d. You can find the video here. The number of objects you see there is close to maximum Alchemy version of box2d could handle. AS3 version failed with much less.
You should google how it was done in old-school games like Scorched Earth for example. Or it might be possible to "cut" sand particles in area of effect of your missile from box2d shape, create many small particles, simulate them and join back to main terrain shape. But it sound very complicated.
Hey guys, I was looking into a simple flash game, and have a few enemies patrolling the area. I made each of them have a view angle of about 35 degrees, and a distance of 150 px. The problem is that they can see through walls. How would I check to see if a wall was in between the guard's view of the player?
I thought of ray tracing, but don't know a way to implement it. I also thought of maybe drawing a rectangle between the player and the guard, and collision check it against the walls, but again don't know how to implement it..
Any ideas?
Thanks,
Max
Just a thought.
Keep your code just as it is, but do a second test.
If it finds a target with your current code run another test to see if there is a wall between them with a ray type test.
This would keep your working code as it is and minimize the field for ray testingto the width of the target.
I think that you are not that far off.
Since your walls will probably be sprites or some other display object, you know their positions ect.
Then you could draw an opaque sprite with alpha 0 that embodies your enemy viewing range and then do a collision test on all walls and all viewing ranges.
This will also enable you to do a collision detection between the player and all enemy viewing ranges.
After a quick search this might be what you need
Cheers