ActionScript 3.0 :: Detect Loose Groups In Tile Game
Sep 16, 2011
I have a tile based game à la Scrabble where tiles are placed on the board.. during the game the tiles must all be touching, and there should be no groups of tiles anywhere else on the board..I can find single loose tiles and check for surrounding tiles easily enough but how would I go about checking if every tile is touching on a horizontal or vertical axis and if there are loose groups of tiles on the board ??
I've messed around a bit in Java and Visual Basic. For our class we've been assigned to make a flash game in groups, and our group has decided they want to do a base defense game. I've been looking hard for open source/tutorial versions of a simple base defense game, but all I've found are tower defense games.
I am trying to make a pacman game and was advised that collision detection for a game like this is much easier if you create it using a tile based methodology. I have the map created and the character moves fine around the grid. But once I added collision detection it seems to be a bit off and inconsistent. Im not entirely sure what the problem is with the collisions.
I've been playing around with ActionScript 3. They have a new way of placing clips onto the stage, "addChild(clip)," which automatically places the clip onto the stage with it's own depth. So here's my problem, when making a tile based game, I have to constantly depth sort to make sure the object lower on the screen has the higher depth than an object higher on the screen. Pretty much, their depth depended on their y-coord. Does ActionScript 3 still let us play with depths?
i am trying to do the following: in a tile-based game i want to attach a bunch of tiles which are movieclips the tiles are all similar in function, only the graphics are different. so i created one basic class for all of them:
Code: package { import flash.display.MovieClip; public class TileMC extends MovieClip {
I trying to make a game like Chicken Get Home.There a different type of levels in the game by arranging the tiles. I made the levels in the art and exported the array value by using mappy. ** How can we use the array value in our code and how to import those levels in the code ** How to move the tile with mouse only to blank position(ie like snapping to next tile)..
I'm building a basic tile game containing 3 layers of 'tiles' image the game has a dimension of 3x3 my data array's look like this:
[Code]...
How can i load this data from an external file which is easy to edit for the level-desiners ? (and what is best to use, xml, json,?) Is is not better to just use 1 datafile instead of 3 and what is the best way to do this?
I'm making a game where you place tiles on a grid. When placing a tile, I need to check the existance of another tile to the left, right, or above and below, otherwise the tile should not be placed.. Here is a function I thought would work, that accepts one variable (the position of the tile just as it is about to be placed) :-
private function checkSurroundingTiles(gridPosition:uint) { var t1 = gridPosition - 12; var t2 = gridPosition - 1; var t3 = gridPosition + 1; var t4 = gridPosition + 12; for(i = 0; i < gridRefArray.length; i++) { var checkTile = gridRefArray[i]; if(checkTile == t1) { return true;
I'm relatively new to AS3. There's one thing that I don't quite understand about Sprites. I'm making a tile based game, and all the tile graphics for a level are inside one movie clip in each frame. Would I be able to go about creating multiple sprites based on the frames in said movieclip's timeline I would I have to go through and make a separate library graphic for each.
im using as3 and components. here i make a combobox.editable=true; i type something inside.. then click outside, the combobox doesn't loose focus. i tried to write stage.focus=null;. but i got d following error
ArgumentError: Error #2025: The supplied DisplayObject must be a child of the caller. at flash.display:isplayObjectContainer/removeChild() at fl.controls::ComboBox/close() at fl.controls::ComboBox/fl.controls:ComboBox::onStageClick()
i just created a basic form in flash nothing too fancy it works perfectly well but when your inputting data and hit tab to go to the next one it randomly picks a box to jump to if you press tab again it jumps out of the flash movie and goes into some random symbol has this ever happened to any of you guys?
I'm trying to come up with a clean function that will perform a check on a 2D Array to verify if a win has occurred in a ConnectFour game. I'm trying to work through the logic but my brain is swiss cheese right now. Here's what I have for checking for a horizontal win. It seems to me like there should be a way to streamline this block to work in all possible directions.
Actaully I am running a cards game. While running the game in between if I change the style portrait to landscape. then how can I detect the screen size and run the game according the screen style (Portrait or Landscape).
Actaully I have written the code to detect the screen as portrait and landscape. But in between if I change the game portrait into landscape, no more it works.
I've noticed recently (the last week) that when I open Flash CS4, the Tools panel and the Actions/Timeline/Compiler Errors/Output panel group are not automatically open, like they always were before. Does anyone know of anything I could have changed by accident?
At the same time this started happening, I have a file that has a moving hot spot that is set with keyframes (depending where the active button is on the bitmaped screen capture behind the button). Even though the button's onRelease handlers are advancing the timeline correctly, my button is not in the right place in the runtime version. If's still fine in the development environment. It's like the layers are out of sync with each other.
I am trying to automatically resize the children within an s:Group. The children are another s:Group and a H:Group. Each have a percentage width of 10% and 90% each. The problem is that when one of the groups is resized (using a transition and rotation combination in the Skin), the other group does not automatically resize to fill the space?
Shouldn't Flex do this automatically? or do I have to code this?
can I somehow create logical groups of objects without actually combining them into symbols which would appear in the libraryI was thinking of this approach
ActionScript Code: var vertFloatGroup:Object = new Object(); // the logical object vertFloatGroup.addChild(splashPhoto); // splashPhoto is an existing instance on stage vertFloatGroup.addChild(nav); // same for nav
interact with the group as a whole this above tells me that addChild is not a function...
I've built a simple file to demonstrate what I'm trying to do (it's all dynamic, with AS3, no physical assets). Basically I've created 3 groups of objects via AS3: squares, circles, and triangles. I've placed 3 menu buttons on the side of the stage. I added all objects to the stage just so you can see them. Ideally I'd like to have each button call one of the groups to the stage and begin the tween that is assigned to the object. In this case I've made all the tweens 'alpha' for simplicity. So for example if the '1' button is clicked, it will add the group of squares to the stage and initiate their alpha tweens so that they fade in. Then when the '2' button is clicked, the squares will be removed and the circles will be added and their tweens initiated. I've never seen a tutorial on this so I'm not quite sure how to proceed. What I'd imagined is to group the objects into arrays then add the arrays to the stage with addChild?
I'm using this as a simple model to build a website where I'm going to be calling the content of each section of the site dynamically with menu buttons, instead of using the timeline at all. This is the next step in my actionscript evolution.
Using the Radio button component and I have 10 groups of buttons. Each group has a group name of g1, g2, etc for each yes/no button. I want to determine which button was clicked. When I run the code below I only get the first one and then each other button clicked I don't get a trace statement back.
var rbListener:Object = new Object(); rbListener.click = function(evt_obj:Object) { trace("The selected radio button group name is "+evt_obj.target.groupName); }; for (rb=1; rb<=10; rb++) { _root["g"+rb].addEventListener("click",rbListener); }
Load data on demand (lazy load data ) for groups in advanced data grid control.When the user expands a node the flex component can make a webservice calla and retrieve data for this group.
ignoring the webservie part, I am trying to figureout how to do the UI part in AdvancedDataGrid ?
I am trying to extend the DataGrid to allow headers for different groups of rows. However, I cannot figure out which method to extend from DataGrid that would allow me to accomplish this. I do not want the headers to be included in the dataProvider, only the rows. I want to specify indexes to insert the headers at using a property of the custom datagrid. Here is a quick photoshop showing what I am trying to do: Is there any custom component already built that will do this?
I don't know anything about regular expressions and I don't really have the time to study them at the moment.I have a string like this:test (22/22/22)I need to capture the test and the date 22/22/22 in an array. the test string could also be a multiple words string:test test(1) tes-t (22/22/22)should capture test test(1) tes-t and 22/22/22I have no idea how to get started on this. I managed to capture the date string with the parentheses by doing:(.*)but that really doesn't get me anywhere.
I've been trying to customize each cell in a ComboBox using a custom CellRenderer class, as instructed on this article. [URL]. However, my problem is I am trying to customize *only* two cells in the dropdown list. And the dropdown is populated by an XML feed so I cannot hardcode which ones to stylize beforehand. In other words, I want to make it look like an HTML dropdown. So, I have been looking for an alternative...maybe a property that I can use or another ComboBox component that can support option groups, like HTML dropdowns.
I am working on a website that will show a portfolio of pictures. I would like to have a scrolling bar at the bottom, similar to what I have seen in this thread by rhamej. This would be perfect for my needs, but I need something that I can put into a movie clip or load in my current swf. Also, I need to be able to have the scrollbar images load up galleries.
For instance, , the image scrollbar scrolls through 15 pictures, starteding with a parrot, then a boat, a cat, a dog, lizards, etc.. When you click on the image of a parrot it will load up a larger pic of that parrot, then will slowly cycle through other pics of parrots. I don't need to see every other parrot pic in any other location, only just as it's cycling through them, nor do I need to be able to physically cycle back and forth
A gallery that loads up a cycling view of each subject, and one that i can include into an existing SWF, not a standalone. I've searched high and low, and everything i found will only do one thing or another, not everything.
I have some radio buttons that are all created dynamically and range from maybe 1-4 or more. Is there a way when I click submit button I can wipe out all of those buttons?
I am currently working on a tile based game in Flash, so im working with a two dimensional Array containing the data for the map the player can jump around in. The script is already able to find all the groups within the Array. In the following example Array it groups the left ones and the right using the zero tiles to divide them:
[1,1,0,0], [1,0,0,1], [1,0,0,1], [1,0,1,1]
I am already able to get the corners of the groups, but still they are not in the correct order. As well some corners exist twice.
get the corners in the correct order and how to get rid of the doubles?
I have about 5 layer groups in Photoshop and in each of the groups/folders there are some layers with some text and other layers with isolated images and also layers with some layer styles. When I import this file into Flash I need each of the layer groups to be imported as a flattened bitmap image. I don't want any of the text to be editable or to have any of the layer styles intact. So if there are 5 layer groups in Photoshop, I just need five bitmap images in flash. I've tried doing this but it still imports the layers separately. I know I can flatten the groups in Photoshop but I want to keep this file editable.
I have the following set up: 6 text input areas when button 1 is pressed these numbers are copied to 6 text areas these 6 (user input) with text areas appear and when button 2 is pressed a further 7 (result) text areas that appear to a timer and contain randomly generated numbers to string I need to compare these two groups of text areas in a way that treats the 7th text area as a special excluded case: