2D Running Game (in first person view) in as3/flash - actionscript-3

I want to learn to make infinite running games like temple run.... but at a very basic level. I am good at as3 and flash... and i have created all the graphics.... the whole scenario of the game is in first person view. And the graphics is all created in Flash.
Can anyone please suggest some tutorials or any techniques that i should use to make the objects look like they are coming from a far point and how i can write the logic of hitting them or escaping them.
Thanks for ur help... :)

Related

Reload a scene in as3

I made ​​a flash game with ActionScript 3. I want when the character falls into water or swamp
or his score=0, the game to be start from first.
I want load scene from first.
I am a beginner in as3. Please help me by details.
But I do not know what code to write.
I'm grateful for your advice.
I can only suggest grouping your level dependent variables and writing your own reset() method that is used to initialise and start the game. Then calling that whenever one of the loss conditions are met to restart the game.
As far as I know, this may not always be a quick and clean thing to do, nor do I know of any single "one size fits all" solution that won't causing any further problems down the line. This is more to do with how your design and layout your game code.

Action script tutorial?

Hi I am a Student in Norway looking for a good general tutorial on Action Script and how to use it,and what it's for.
I have been looking around google for a while and I can't seem to find any good or "simple" way to learn or even understand how it works.
sites i've been too:
(http://www.actionscript.org/resources/categories/Tutorials/)
(http://www.flashandmath.com/)
(http://tutorials.flashmymind.com/)
(http://tutorialoutpost.com/tutorials/flash/actionscript)
(http://www.tutorialguide.net/programming/actionscript/)
(http://www.siteground.com/tutorials/actionscript/)
(http://www.kirupa.com/developer/flash/index.htm)
(http://www.freeprogrammingresources.com/actionscript.html)
(http://www.adobe.com/devnet/actionscript.html)
So what do I want to know ?
Basic scripting to advanced scripting.
Where it's best to use action script. (best functions)
A simple yet efficient explenation that alot of people might understand.(if possible)
So if there is any way you guys might be able to help me with this little problem of mine I would be forever in your debt.
and thanks in advance for any info that might come my way, even if it helps me or not.
Check out this too: http://www.gotoandlearn.com/. It has some good free tutorials, but if I remember correctly, you need to pay for the full series!..
And the best approach to learn something is to read the documentation while working on something! Try create a game/small site/interactive animation/etc and when you are stuck, search the answer or ask for help!
ActionScript is similar to Java and C++ but different. It runs on the Flash Player. It is generally used for applications ranging from online games to video players to Rich Internet Applications.
Flash can be developed from 2 perspectives:
Designer's perspective: This approach consists of drawing objects, shapes etc on a stage like you do in an image editing software, and then animating / adding actions to the drawn objects. You develop this in Flash Professional (Link here)
Developer's perspective: This approach consists of developing using the Flex framework, from an IDE (Flash Builder)
Check these out. I learnt it by looking at various tutorials on the net (do a Google search, you'll find plenty), so you can learn from the net as you go.
I often recommend Colin Moock's Lost Actionscript Week End video tutorials , it's an excellent resource if you want to grasp the general concept behind AS3 and leaves you with enough understanding so that you're able to tackle books on Object Oriented programming, AS3 language reference, basically tools that you will eventually need when you get deeper into the subject.
http://tv.adobe.com/show/colin-moocks-lost-actionscript-weekend
Why don´t you try the official Google Action Script documentation? You can find it at https://developers.google.com/apps-script/ . I fount it very useful and easy to understand... It is very well organized and there are many examples with diverse grade of complexity. For example: you have there 5-minutes overview for your first Google Action Scrpipt https://developers.google.com/apps-script/overview#what_can_apps_script_do
And if you are looking for a more complex example, you can go forward to end-to-end examples: https://developers.google.com/apps-script/articles/bracket_maker
That is my first reference point with Google Action Script...

How to design and write a game efficiently?

I'm writing a very simple Java Game. Let me describe it briefly:
There are 4 players in a Map.
The map is a two-dimensional matrix with a value called "height"
The height between 2 nodes is the cost of that edge.
Use Dijkstra algorithm to help player navigate from a source to a destination.
Four players take turn to make a move. The total move is 8( left top, top, right top.... )
If they meets, fight for gold value, otherwise move to their target.
As they move, their strength decrease by the height difference between two nodes.
... etc
....
The problem that I'm encountering is that the source code is getting longer and complex day by day. And I think I'm using a wrong approach somehow, I feel so tired because of constantly changing the implementation. Here is my approach:
Write out all requirements.
Create all the object that I need with all getter and setter.
Create a static class to test the logic
Create unit test while putting the logic together
Add some more code, then change to code to fit the test
Write a big method that run, then break it down into smaller methods, then write unit test again.
If everything work fine, add more requirements, add more code
Then things are getting complicated because the more code I added, the complexity increases. No longer have time to write unit test because create a test case now requires too much work
Re-design, then change the implementation, go to step 1 again.
I'm come from a C++ background, and I'm only comfortable with writing 'static' libraries such as: stack, queue, link-listed, tree... Game is really a big challenging to me, especially I have to use Java. I understand the core programming is the same, so picking up Java was not really that bad. However, the time of looking up Java's API is not little. Further, the game logic is really hard to write. When this object moves, other object got affected..., so creating test for a method depends on many other methods...etc.
I really need an advice. Could anyone share some experience of how to write a game to me? I only have two weeks left for this assignment. I'm currently have 45 classes now, I feel so lost because the more I wrote the more it gets complex :( !
Best regards,
Chan Nguyen
First start thinking like a java programmer. Think as every thing in your game as an object, like the board, think about the properties and methods it has, its interfaces, how it interacts with the other objects.
If you need help getting started here is a great tutorial that guides you step by step to do a simple java game, this might put you in the right frame of mind to start programming your own. I strongly recommend you to follow the tutorial.http://www.cokeandcode.com/asteroidstutorial and to use the libraries that they used for developing the interfaz there.
I view game code architects with respect: games are complex systems with emergent properties at runtime, unusually intense interaction requirements (UI, controls) which makes a lot of OOP theory questionable value. It can be difficult to reuse game code. And, a lot of upfront planning work is wasted time.
Most game coders I know, beginning or veteran, succeed with a "just do it" iterative process. e.g.
1) write a minimal prototype. get a very basic system working, using the simplest, most obvious architecture you can think of. (my guy can run around the screen). 5 or 10 objects max.
2) add functionality (points, rules, traps, NPC behaviours, etc) and playtest, over and over. This hack on hack can makes for poorly structured code, but most coders can make it work.
3) rewrite. Programmers grit their teeth at some of the hacking they had to do in (2), and will want to throw it all out and rewrite. Resist this urge until the game is testable (as in, plyaers can sometimes enjoy it, somewhat), or a new feature would require rewriting. Then, rewrite pretty much EVERYTHING from scratch. This goes WAY faster than you'd expect, and results in solid, well-structured code.
Game coders do test, but comprehensive testing of ALL code is rare. two reasons: emergence and culture. Games have emergent properties at runtime ("yeah, but the points COULD go negative when the NPC is killed when ...."). Since games are usually for entertainment purposes, there is a culture of fast-and-loose testing. Games aren't as important as, say, missile control code.
I expect others with more coding experience answer this. (I have written a fair bit of code but I tend toward quick and dirty script type coding style - I know lots of coders who are way better than me.)

This Question about how do i learn from basic As3 to advanced as3

This Question about how do i learn from basic As3 to advanced as3 , as i want to become professional in as3.And work as freelancer.
can anybody guide me how to reach to the peak of Action-Script-3.
This question seems to be really funny to many but this is the most basic question in my mind
1) which way to go.
2) what steps i should follow.
3) how should i do my first project professionally.
4) how do i become excellent in as3
I believe actionscript 3.0 and Flash in general allows you work on a wide variety of projects:
from interactive rich media web interfaces, to interactive video, animation, games, desktop applications, rich internet applications, physical installations, creative and abstract pieces, etc.
It's up to you what you want to do, but I'm guessing if you start with something that motivates you, something that you enjoy working on and learning, it's a sure way forward
and it will make the boring bits more fun, and that's what it should be about: FUN!
It doesn't matter if it's actionscript or something else you want to learn, enjoy learning/challenging yourself and you'll get there faster than you think.
Answer 1.):
With regards to actionscript, based on what you want to do with it, there are a couple of good starts. Let's say you're interested in just the code, not planning to use the Flash IDE much or at all, and your aim to develop great applications. as #David Morrow said, Colin Moock's Essential Actionscript 3.0 is great. Also his guide From the Ground Up is a compressed version of the book.
An easier lecture, but packed with hands-on tips to getting things done in actionscript 3.0 is Rich Shupe's Learning Actionscript 3.0, also from O'Reilly. This might help you get up to speed with project you might have in mind.
Answer 2.) and 3.):
In short you have at least two routes:
easy/practical start where you learn
by doing small mini projects, but
keep in mind there are gaps to fill
in order to move on to complex
projects
a 'harder'/more theory based start,
that will cover advanced topics, so
you will ready to take most projects
out there, simple or complex.
Answer 4.):
It also important to keep in mind that there is no substitute for experience! Learn how ever it feels comfortable, but plan time for practicing/writing a lot of code/failing/fixing/repeating. Don't worry about getting things wrong! I don't know any programmer that can write a complex project perfectly from start to finish. Basically all projects out there are the result of this loops of failing/fixing/learning/ if you want to put it this way.
Never be afraid of getting things wrong ! You learn more this way, than getting things right, but not fully understanding why, also, you can discover something new. You can't run
into happy accidents if you don't have accidents at all.
As you progress you will like some things more than others. It is important to try everything when you learn. Knowing what you don't like is just as important as knowing what you like. Don't take everything for granted and form your opinions while learning.
You mentioned peaks. It's great to aim high. As I mentioned earlier, actionscript can be used for so many things, that it's hard to be the best in all areas. Andre Michelle and Joa Ebert for example are very talented developers and have a lot of experience with sound. Chris Georgenes on the other hand is a very talented animator. I wouldn't expect roles to swap anytime soon. If it helps, choose people that are actionscript virtuosos, get inspired by their works, there are plenty of them out there.
HTH,
George
understand OOP classes and packages.
Inheritance and polymorphism
keep all content in external xml files
dont ever put any code in your fla
start building a library of reusable classes for common tasks ( a util library )
start working with the Essential Actionscript 3.0 and you are on your way...
read and understand this entire book and you will be rolling
The simplest, yet probably most important answer is: Use it.
The only way you'll become advanced in AS3 (or any language) is to just start using it. Do some experiments, maybe create some small tools for yourself, or find an open source app and start contributing to it.
Books will help, but they're no substitute for actual experience using the language.
As they say, you need to learn to crawl before you can walk.
You need a solid understanding of programming. See David Morrow's answer for things you should know. Also add to the list a knowledge of datastructures.
Start programming. As George Profenza said, start with a simple project first and something that you will enjoy doing. If you undertake something too big you may end up disillusioned. The best thing about working on little things often is that you will encounter certain problems, and you will learn through experience on how to tackle them.
Once you have the basic hang of things start looking at other people's source code. Visit blogs of various well known flash developers and go through their code. Learn from the best. My blogrole is a list of such people.
After a while, maybe a year or so you will be a decent AS3 programmer. Remember AS3 is just a tool. What seperates the men from the boys is being able to solve problems. Start tackling more complex problems, for example, develop a voxel engine or something along those lines. The best programmers tend to experiment with problems in the field of computer science. In doing so, they become knowledgable on various things like 3D rendering, Audio etc and develop unique skills placing them on the cutting edge.
Well I'm a visual programmer, i only learn as a means to an end - I want to make things.
If you are as i am - then here's what I recommend to go from basic AS3 to advanced AS3.
Make a game. OR, and this might be an even better route.
Clone a game that you like - e.g. tetris, bomberman, pacman
I know it a single statement answer.... not fancy, but - you will HAVE to learn so much in the process of creating it.

Dependency Injection framework suitable for as3 games and regular rich media sites

Doing a bit of research on dependency injection frameworks for AS3 to retain loose-coupling of classes and boost our re-usability of code. I've been looking heavily at RobotLegs. There's a whole lot I still don't understand about the framework but it seems ideal for our regular Rich Media apps but has anyone used this framework for AS3 games? if so is it a good framework for games or should I be looking for another framework? I've heard that the MVC pattern isn't ideal for game design but would love to be set straight on this :)
I'd love to hear from anyone who's used a dependency injection framework for games, how it faired for them!
Cheers,
Anton
I used RobotLegs for a game that required integration with a few different backend services. One service gave me a multi-player lobby area to allow players to challenge each other, one handled the head-to-head gameplay after a challenge, and one allowed players to access information from their social network accounts.
From the beginning, I planned the game's architecture as if I were building a Rich Internet Application. The game itself was an implementation of a popular turn-based board game. Thinking about how to run a local game vs a network game definitely helped me stay on track with the MVC framework approach to game development. There was a ton of code that could be reused, and the difference between interpreting a local player clicking with their mouse versus receiving a message through the network to indicate that a remote player did something similar helped me see what logic simply couldn't be tied to the view at all. I was able to use models, commands, and mediators very smoothly, and in the end, it made the game's code more maintainable and easier to understand when I delivered it to my client.
I think most games will have a basic model that tracks the "board" whether it be pieces in a grid or enemy ships and asteroids out in space. Once you're thinking of the model as a separate entity from the view, it should be easier to imagine how player interactions through mouse and keyboard could trigger commands from controller to make changes to the model and notify the view of those changes. For some simple games, that might end up being a lot more work. For others, such as those where long-term maintenance or multiple input methods are required, it can save some headaches.
Let's think about the different views in a game for a second. Views can include a title screen, a settings/options screen, a multi-player lobby, high scores/leaderboard screen, and the main game itself (which could consist of many smaller views!). Many of these views can have models, like the list of high scores, the various settings (which should be shared between the options screen and the game views), the list of players waiting for a game, and the current state of the game, etc. By the way, need a way to save the game so that a player can restart where they left off? It's way easier to do that when the data is in a model and not tied directly to the view.
I think that too many Flash developers look at games as hugely different beasts from Rich Internet Applications. An MVC framework can be appropriate for a game, especially for multi-player and for games that you intend to iterate on over a longer period of time to add new content and features. The biggest challenge is making yourself remember the fact that cute, little furry critters running across your screen is just a visualization of data that might easily be displayed in a different way using DataGrid or a chart... though it may not be as fun to play with them that way!
RobotLegs is brand-new, so you'll struggle to find many people who've used it in production. They finally moved from release candidates to a first stable version last week. However, it has been created by a whole bunch of extremely well-respected coders and if your project is across the middle-to-long term, you will see adoption of RobotLegs explode during the lifetime of your project. It is going to be what all the cool kids are using! :)
(I have no stake, other than having occasional communications with some of the authors via Twitter and across the blogosphere).
HTH
AS3 is not my business at the moment, but game-frameworks are ;)
So, yes and no, MVC pattern are not your first choice, because you do not create that much views, controllers and models.
You have something more like an interface, some generic "engine" processing the game mechanic, and some database tables.
I currently use some aspects of MVC but not the complete pattern - "just the benefits".
EDIT:
You "can not say that:" MVC is not designed to be used inside a game (engine), because the MVC pattern only describes a logic, and not something pre-defined, like "the code always has to contain $x and must begin with include($y)".
It is just a design pattern, which does not directly affect the quality of the code, rather the progress and how you go on with your game design.