Actionscript 3 :: Unlimited Map Dimensions For A Game?

Apr 21, 2011

Recently I've been planning out how I would run a game with an environment/map that is capable of unlimited dimensions (unlimited being a loose terms as there's obviously limitations on how much data can be stored in memory, etc). I've achieved this using a "grid" that contains level data stored as a String that can be converted to a 2D Array that would represent objects and their properties.Here's an example of two objects stored as a String:

"game.doodads.Tree#200#10#terrain$game.mobiles.Player#400#400#mobiles"

The "grid" is a 3D Array, of which the contents would represent the x/y coordinate of the grid cell. The grid cells would be, say, 600x600.An example of this "grid" Array would be as follows:

var grid:Array = [[["leveldata: 0,0"],["leveldata 0,1"]],
[["leveldata: 1,0"],["leveldata 1,1"]]];

The environment will handle loading a grid square and it's 8 surrounding squares based on a given point. ie the position of the Player. It would have a function along the lines of

function loadCells(xp:int, yp:int):void

This would also handle the unloading of the previously loaded cells that are no longer close enough to be required. In the unload process, the data at grid[x][y] would be overwritten with the new data, which is created by looping through the objects in that cell and appending each new set of data to the grid cell data.works fine in terms of when you move in a direction, cells are unloaded/saved and new cells are loaded. The problem is this:

Say this is a large city infested by zombies. If you walk three grid squares in any direction and return, everything is as you left it. I'm struggling to find a way to at least simulate all objects still moving around and doing their thing. It looks silly when you for example throw a grenade, walk away, return and the grenade still hasn't detonated.

I've considered storing a timestamp on each object when I unload the level, and when it's initialized there's a loop that runs it's "step" function amount of times. Problem here is obviously that when you come back 5 minutes later, 20 zombies are going to try and step 248932489 times and the game will crash.

View 3 Replies


Similar Posts:


Actionscript 3 :: Finding An Original Rectangle's Dimensions From Rotation And Bounding Box Dimensions?

Jan 25, 2010

In AS3, I have a Sprite that has a Z axis rotation applied.How do I calculate that Sprite's dimensions (it's original size) from Sprite.rotationZ and Sprite.getRect(...)?

View 2 Replies

ActionScript 3.0 :: Fixed Movieclip Not To Change Dimensions If The User Starts Playing With The Dimensions Of His Screen

Jan 31, 2012

What do I have to write to keep the movieclip not to change dimensions if the user starts playing with the dimensions of his screen ? I remember it was a line of as3 written at the beginning.

View 3 Replies

IDE :: Duplicatemovieclip Unlimited Times?

Jun 23, 2009

I am trying to duplicate a movieclip unlimited times. Right now it will play when it is rolled over one time and then it will duplicate for the second rollover, but that is it. I need it to keep duplicating every time it is rolled over.

The code:

[code]...

View 2 Replies

CS3 Load Same MC Unlimited Times Read Please

Sep 23, 2010

i have this movieclip that needs to load many times but only if its called.here is the xml example why it needs to load many times.Url...if a user post a comment it inserts to database via mysql.and then get pulled back via xml.I have upload the fla file to let you see what it does but the main clip needs to load every comment. but it loads one i need to loop it some how.[code]

View 3 Replies

ActionScript 3.0 :: Unlimited Number Of Images Through XML

Jan 20, 2010

I'm loading in an unlimited number of images through XML. I've got it so that it creates an MC for each image and adds each image to it. I need to position them into 2 coloumns and an unlimited number of rows.. so like :

1 2
3 4
5 6
7 8 .. etc

You'll see from my AS below i've got the code to position them along side each other, i just need the MCs to move down a row every 2..[code]My maths brain is about to explode so could anyone enlighten me as to the best way to do this?

View 9 Replies

Actionscript 2.0 :: XML Menu Unlimited Levels

Jan 26, 2009

I want to know how to build an unlimited levels xml menu. I know how to built a normal one.

View 3 Replies

Actionscript 3 - Unlimited Params In Flash For Object?

Apr 19, 2011

...args is for string. something possible for Objects ?

View 1 Replies

Flash :: Check Function For Unlimited Arguments?

Jan 17, 2012

if i have function :

function a( param:* , ... args ):void ;
a.length // 1
flash.utils.sdescribeType(a);
//return me informations only about first parameter , nothing about '... args'.

edit: avmplus.describeTypeJSON didnt too. So , is there any other way to check for unlimited arguments than try{} block and push lot of params ?

View 1 Replies

ActionScript 3.0 :: Signed Up For Two Unlimited Hosting Accounts?

Sep 23, 2009

wanted to know does action script work on Linux or windows what is the best platform to choose for integration. I have signed up for two unlimited hosting accounts, with [URL]..

View 2 Replies

ActionScript 3.0 :: Make Stage And Background Unlimited?

Jun 18, 2011

i want to make my game stageand background unlimited when when my player character moves to the right how can i do that? i wouldlove a sample code

btw my background is a movieclip

View 3 Replies

ActionScript 3.0 :: Flash Store (unlimited?) History In XML?

Apr 6, 2012

As a personal project, I'm working on a language-learning flash game.I'm looking at the information I'll need to store in various XML documents.I'm implementing a 'history' feature whereby, for any given word in the database, for any given user, a comprehensive history of data is stored. With this data, I can generate all sorts of fancy graphs to track any given user's progress.For example:You have been asked the word 'cat' 10 times. From data stored in the XML document, the game generates a graph of the time it took to answer each of those 10 times. (So in a perfect world, you see a nice downward curve. Congrats.)My question is how to organise the XML document (if that's the way to go with this) so that it is as efficient as possible.Right now, I can only see the brute force approach: have a limited number of predefined history states (say 99), and write data to these each time 'cat' comes up. Once they're full, overwrite.

Code:
<user#>
<word#321>

[code].....

View 3 Replies

ActionScript 2.0 :: Flash 8 - Unlimited Amount Of Images In Slideshow

Mar 23, 2006

I'm trying to do the following to a flash banner, I'd like to know if it's possible and how I would code it/do it.
1. Unlimited amount of slide support. The banner must look for 01.jpg, 02.jpg, 03.jpg... etc. Let's say the current slidshow has 4 photos, they want to be able to just upload another image and create a new .as file to make it appear in the flash slideshow.
2. each link must be in its own independent script. For example 01link.as, 02link.as, 03link.as etc.

View 6 Replies

ActionScript 2.0 :: Limited Flash, But Unlimited Html Area?

Aug 22, 2006

so much entries here about full screen flash, but i coultnt find what i wanna know. i read the tutorial about the full screen flash, but it wont work the way i wish it would. what i wann have is a swf embeded in an html. the swf size is 950 px x 550 px and is in the absolute middle from all sides of the browser. if you scale your browser, it should scale itself smaller, but not bigger than the beginning resolution. within the swf file there is a game, that opens in a seperate window in front of the main swf. that window should be dragged whereever you want in the browser.

but i just figuered out what i have to do, to give the window some freedom. but when i want to drag it above the main swf i cant do that. i figured out that when i drag it to the left, there is the same problem, but the further right i press the mouse on the window, the further i can drag the window to the left. same is on top - on the right and the bottom site there is no problem.and the html code is:

ActionScript Code:
</script>
</head>

[code].....

View 1 Replies

ActionScript 3.0 :: Unlimited Movieclip Object Stack And Drag?

Apr 20, 2010

new to actionscript and im currently building a webpage. inside the page im going to run a simple flash application but im struggling some with a certain part of the code. basically i want a unlimited deck of cards. and i want to be able to drag the cards all over the screen. i have the dragging code down, but i can figure out how to make an unlimited amount of movieclip objects in a stack. this is what i have now

reset_btn.addEventListener(MouseEvent.CLICK, resetbuttonClicked);
function resetbuttonClicked(event:MouseEvent):void
{

[code].....

View 2 Replies

Android :: Cross Platform Game - IOS : Develop A Very Simple Game For Iphone/ipad?

Mar 7, 2012

I am going to develop a very simple game for android and for iphone/ipad I have the option to develop it in cocos2d or in adobe flash air (i am not a developer, but i have 2 developers who are offering me the service)I have a developer that states that cocos2d is better and other one that states that adobe flash air.I want it in cross platform.the cost offered by both developers is the same..i have heard that adobe air has the flaw that it is very slow, is this real? if you had the 2 options which will you use to develop your game and why?

View 1 Replies

ActionScript 3.0 :: Game That Populates User-designed Cards Into The Game Using An External Xml File

Apr 24, 2011

I'm making a game that populates user-designed cards into the game using an external xml file. My main class loads the xml file and then calls to the "Card" class, which wants to use the xml file. I've tried using this.parent and it just gives me a null object reference error. This is what I have so far: Main.as

[Code]...

View 2 Replies

ActionScript 3.0 :: Making Game And Objects Would Spawn At Random And Be Able To Click But When De Game Starts Itself

Jul 4, 2010

currently i making this game and objects would spawn at random and be able to click but when de game starts itself, the spawn is correct but i am unable to make it stop when time goes to 0seconds.

View 1 Replies

ActionScript 3.0 :: Flash - Writing A Simple Game Rule For A Platform Game?

Feb 28, 2011

I'm creating a game at the moment for my university course and it involves the player character jumping on top of boxs twice to break them as opposed to just once.What would be the most efficient/simple way of writing this in Actionscript 3.

View 1 Replies

ActionScript 3.0 :: Mahjong - Levels Of Blocks In Game - Layouts Of The Game Should Be Predefined Or They Should Be Dynamically Created?

Aug 3, 2011

I have recently started working with Mahjong game. But being not so experienced developer. I am just confuse about many aspects of it. So if anyone could throw some light on it. I have to build the game where there could be different number of tiles on screen. 32, 48, 64 , 80, 96, 112 and so on Now I have questions regarding the levels of blocks in this game. I mean the layouts of the game should be predefined or they should be dynamically created? Also I wanted to know how the surface of enable and disable symbols are created?

View 2 Replies

ActionScript 3.0 :: Make A Game, And The Character Inside The Game Could Swim

Jun 13, 2009

I was trying to make a game, and the character inside the game could swim. However, I only wanted him to swim in short bursts that refueled every time he hit the ground.

View 9 Replies

ActionScript 3.0 :: Making A Game Like Pokemon Trading Card Game?

Jul 23, 2010

im trying hard to make a Game like the Pokemon TCG .

View 2 Replies

Flex :: 2d Game Engine For Race Game Built To Webpage?

Nov 19, 2009

I think Flash/Flex is a good aproach for this case.We need to build some like the following

View 2 Replies

Actionscript 3 :: Flash Game Engine Selection Of An Awesome Game?

Dec 14, 2011

I am thinking of developing of a game like this: [URL]... Do you have any idea - by which game engine I may develop this type of games? I am not sure whether I have to use any 3d physics engine? I think JiglibFlash may be useful, but I am not sure.

View 1 Replies

Actionscript 3 :: Make A Game Tutorial Of Flash Game?

Apr 1, 2011

how to make a game tutorial as farmville game tutorial to teach the user to play the game. i have recently involve in make that kind of game tutorial for its user by actionscript 3

View 1 Replies

ActionScript 3.0 :: Create A Tamagotchi Game Type Game?

Mar 28, 2012

im trying to create a tamagotchi game type game. For some reason i can not add any items to the stage.Currently i have imported 2 png images to the stage and coverted them to movie clips. One is called TamagotchiCharacter and the other is called Beer. I have also created a new 2 AS3.0 script class called TamagotchiGame and DraggableItem. The following is TamagotchiGame:

Code:
package {
import flash.display.MovieClip;
public class TamagotchiGame extends MovieClip {

[code]....

I have assigned the above code as the BaseClass of the Beer symbol, this has allowed the beer to become draggable and droppable etc.when i run the program nothing happens, i just get a blank white screen.

View 2 Replies

ActionScript 2.0 :: Game Development - Game Character Dialogues?

Jan 22, 2010

It's about the "Game Character Dialogues", It is used to instruct the user what to do, like what you see in BookWorm or Diner DAsh.I used dynamic text fields to generate these dialogues,but as I continued doing it. I found myself stuck.I have no idea on how to change the words when the "next" button is clicked. there will be no previous button. but the dialogue will replay when the character is clicked.

View 3 Replies

ActionScript 3.0 :: Tracking Time - Count The Seconds Passed While Playing The Game And Gives A Bonus Multiplier To The Current Score When The Game Ends?

Mar 15, 2009

Is there a way to get this code to work? It's meant to count the seconds passed while playing the game and gives a bonus multiplier to the current score when the game ends. I don't know how to get the returned value to combine it into the multiplier int variable. Is there any way to get this code to work or is it completely wrong?

View 11 Replies

Dimensions For IOS App

Jan 24, 2011

I have a flash app for web which is 971x570. I am planning to make it into iOS app and was wondering if I can do it with 971x570 dimensions or will have to use 480x320 px dimension as provided in the iOS template in Flash CS5 and thus modify my content.

View 1 Replies

ActionScript 3.0 :: Sound Repeats From Game To Game

May 19, 2010

We have a bug in one game whereby the sound of the word repeats. Even when we use stopAllSounds - the sound is still kept in memory and you can hear it in the next activity - it's a disaster and kids get real angry.

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved