Jump to content

dcole.ath.cx

Members
  • Posts

    430
  • Joined

  • Last visited

Everything posted by dcole.ath.cx

  1. I think the final script will only see tiles it can go though, then I will just have cars pick random spots on the map and plot a path there, I don't know about cars hitting each other... and can't do a hitTest. Maybe I will look at min or max, X or Y... then if the car is moving up, it will look at min Y. If it's moving left look at max X...O, then... if where looking at max X, I will get min and max Y and see if the cars min and max Y are between the other objects. ideas...here is the code for clicking a box and having the char plot and move to the tile. fscommand("allowscale", false);fscommand("allowscale", false);// our map is 2-dimensional arraymyMap1 = [[1, 1, 1, 1, 1, 1, 1, 1], [1, 0, 0, 0, 0, 0, 0, 1], [1, 0, 1, 0, 1, 0, 0, 1], [1, 0, 1, 0, 1, 1, 0, 1], [1, 0, 0, 0, 0, 0, 0, 1], [1, 1, 1, 1, 1, 1, 1, 1]];// declare game object that holds infogame = {tileW:30, tileH:30};// walkable tilegame.Tile0 = function () { };game.Tile0.prototype.walkable = true;game.Tile0.prototype.frame = 1;// wall tilegame.Tile1 = function () { };game.Tile1.prototype.walkable = false;game.Tile1.prototype.frame = 2;// declare char object, xtile and ytile are tile where chars center ischar = {xtile:2, ytile:1, speed:2, moving:false};// building the worldfunction buildMap(map) { // attach mouse cursor _root.attachMovie("mouse", "mouse", 2); // attach empty mc to hold all the tiles and char _root.attachMovie("empty", "tiles", 1); // declare clip in the game object game.clip = _root.tiles; // get map dimensions game.mapWidth = map[0].length; game.mapHeight = map.length; // loop to place tiles on stage for (var i = 0; i<game.mapHeight; ++i) { for (var j = 0; j<game.mapWidth; ++j) { // name of new tile var name = "t_"+i+"_"+j; // make new tile object in the game game[name] = new game["Tile"+map[i][j]](); // attach tile mc and place it game.clip.attachMovie("tile", name, i*100+j*2); game.clip[name]._x = (j*game.tileW); game.clip[name]._y = (i*game.tileH); // send tile mc to correct frame game.clip[name].gotoAndStop(game[name].frame); } } // add the character mc game.clip.attachMovie("char", "char", 10000); // declare clip in the game object char.clip = game.clip.char; // calculate starting position char.x = (char.xtile*game.tileW)+game.tileW/2; char.y = (char.ytile*game.tileW)+game.tileW/2; // place char mc char.clip._x = char.x; char.clip._y = char.y; char.clip.gotoAndStop(char.frame);}function moveChar(ob) { // is char in the center of tile if ((ob.x-game.tileW/2)%game.tileW == 0 and (ob.y-game.tileH/2)%game.tileH == 0) { // calculate the tile where chars center is ob.xtile = Math.floor(ob.x/game.tileW); ob.ytile = Math.floor(ob.y/game.tileH); if (game.clicked) { game.clicked = false; findPath(char.xtile, char.ytile, game.targetx, game.targety); return; } if (game.path.length>0) { game.targety = game.path.pop(); game.targetx = game.path.pop(); // right if (game.targetx>ob.xtile) { ob.dirx = 1; ob.diry = 0; // left } else if (game.targetx<ob.xtile) { ob.dirx = -1; ob.diry = 0; // up } else if (game.targety>ob.ytile) { ob.dirx = 0; ob.diry = 1; // down } else { ob.dirx = 0; ob.diry = -1; } } else { ob.moving = false; return; } } // move ob.y += ob.speed*ob.diry; ob.x += ob.speed*ob.dirx; // update char position ob.clip._x = ob.x; ob.clip._y = ob.y; // face the direction ob.clip.gotoAndStop(ob.dirx+ob.diry*2+3);}function getTarget() { // must click on walkable tile if (game["t_"+game.ymouse+"_"+game.xmouse].walkable) { // update target tile game.targetx = game.xmouse; game.targety = game.ymouse; // if moving, wait until center is reached if (!char.moving) { findPath(char.xtile, char.ytile, game.targetx, game.targety); } else { game.clicked = true; } }}function addNode(ob, x, y, targetx, targety) { // name of the new node path.name = "node_"+y+"_"+x; // add to the unchecked neighbours, if its walkable if (game["t_"+y+"_"+x].walkable) { // find estimated cost to the target var cost = Math.abs(x-targetx)+Math.abs(y-targety); // and if its not visited yet if (path[path.name].cost>cost or path[path.name].cost == undefined) { // make new node path[path.name] = {x:x, y:y, visited:false, parentx:ob.x, parenty:ob.y, cost:cost}; // add to the array for (var i = 0; i<path.Unchecked_Neighbours.length; i++) { if (cost<path.Unchecked_Neighbours[i].cost) { path.Unchecked_Neighbours.splice(i, 0, path[path.name]); break; } } // didnt add it yet, too much cost, add to the end if (i>=path.Unchecked_Neighbours.length) { path.Unchecked_Neighbours[path.Unchecked_Neighbours.length] = path[path.name]; } } }}function make_path(ob) { // create path array game.path = []; // loop until no more parents while (ob.parentx != null) { // add the x and y game.path[game.path.length] = ob.x; game.path[game.path.length] = ob.y; // mark the tile game.clip["t_"+ob.y+"_"+ob.x].mark.gotoAndStop(2); // make its parent new object ob = path["node_"+ob.parenty+"_"+ob.parentx]; } // start moving again char.moving = true; // show time it took to find path _root.pathtime = getTimer()-game.pathTime add " ms";}function findPath(startx, starty, targetx, targety) { // clear marked tiles for (var i = 0; i<game.mapHeight; ++i) { for (var j = 0; j<game.mapWidth; ++j) { // name of new tile var name = "t_"+i+"_"+j; game.clip[name].mark.gotoAndStop(1); } } // start timer game.pathTime = getTimer(); // make new path object path = {}; // make new array for unchecked tiles path.Unchecked_Neighbours = []; // not done yet path.done = false; // initialize path.name = "node_"+starty+"_"+startx; // create first node var cost = Math.abs(startx-targetx)+Math.abs(starty-targety); path[path.name] = {x:startx, y:starty, visited:true, parentx:null, parenty:null, cost:cost}; // add node to array path.Unchecked_Neighbours[path.Unchecked_Neighbours.length] = path[path.name]; // loop while (path.Unchecked_Neighbours.length>0) { // get the next node var N = path.Unchecked_Neighbours.shift(); // we've finished if (N.x == targetx and N.y == targety) { // done make_path(N); path.done = true; break; } else { N.visited = true; // right neighbour addNode(N, N.x+1, N.y, targetx, targety); // left neighbour addNode(N, N.x-1, N.y, targetx, targety); // up neighbour addNode(N, N.x, N.y+1, targetx, targety); // down neighbour addNode(N, N.x, N.y-1, targetx, targety); } } // remove path object delete path; // check if path was found if (path.done) { // we reached the goal return true; } else { // we couldn't get there; return false; }}function work() { // find on which tile mouse is game.xmouse = Math.round((_root._xmouse-game.tileW/2)/game.tileW); game.ymouse = Math.round((_root._ymouse-game.tileH/2)/game.tileH); // place mouse mc _root.mouse._x = game.xmouse*game.tileW; _root.mouse._y = game.ymouse*game.tileH; var ob = char; // move char if (!ob.moving) { // stop walk animation ob.clip.char.gotoAndStop(1); } else { moveChar(ob); // walk animation ob.clip.char.play(); }}// make the mapbuildMap(_root["myMap1"]);stop();
  2. what??you can make a path that crosses over if you are careful, or you can just make alot of paths on the same time line, then it will jump from one to another as it plays though the timeline.
  3. Games coming to a slow down... I'm going to have to develope mine and other people's ideas.I'm removing all hitTests from the game... they really slow it down. In one test file the car stop and will not function because they hitTest is True and False and the same time (or switches back and forth during the redering of the script)so I'm going to have to use X,Y location and distances from each object.I'm also starting to look at path finding, for police and stuff. I will upload 4 files or so to my blog and also post the script so people can look at them and give ideas for how to path find... If the entering and exiting gets done, I will beable to make the game with out other movement besides your own guy. I guess I could show off that much to prove myself.--- ---does anyone here but SFB understand AS or have the ability to understand it... like I don't know AS but it's so close to PHP that it's easy enough to do.
  4. I know why Opera is best, it's made in the same country where Telemark skis were invented That has to be it..
  5. What script could I use to remove parts of an array if it's repeated?like$test = "I wish I was a moderator. I wish I was a bus driver. I love smiles!$data = explode(" ", $test);SOMETHING---then the new array would be: I, wish, was, a, moderator, bus, driver, love, smiles!As you can see the repeat of a word was taken out.
  6. I know alot about running your own server.. I run my own server.Any computer can be made into a server... a server is just a computer with web server software install (apache, ISS...)New real servers can cost $1,000 - $4,000 basicly... you can find them at any range but that's what I've seen.My first server cost me $0! My parents were going to though it away... my 2nd server cost another $0! because were were no longer using the computer (it's a 6 year old gateway, with 40 GB of HD space, ~650 MB of RAM, Fedora Core 5, and Apache)Computers and servers cost about $3 a year for power, this may very depending on how big the Computer is and many different factors but it's really a small number. Then domains cost around $10 a year to own, you can find sub-domains for free.The down side to owning your own server is when you add other devices to the network that innerfer with ports (wireless cameras for example... GRR) Also faulty routers is another one... yeah defective stuff is hard to work with but you can't blame the server on other hardware...With Fedora Core 5, web server setup is very easy... You don't need alot of knowlege (really!)With owning your own server, you don't have alot of the limitation that being hosted by someone else has.. You don't have to log on to FTP or use a special program, with my server I use it just like a normal computer but with web pages. Alot of people will tell you that hosting your self is a bad idea because when bad stuff happens. Well unless you buy every new toy for your network yet no nothing about computer, then you will have problems. If your making web pages with out a template, then you can have your own server.--- ---How to get your own server set up:1. Get the URL (web address) to your house.. sign up for a domain or subdomain and put your external IP address for the location to send to. (you can even search google for My IP Address if you can't find it... websites can view your external IP address)2. Get the server set up, get the web server started... it will automaticly accept all incoming web address, maybe make a TEST page.3. Log in to the router if there's more than one computer on your network. Go to port forwarding and forward port 80 to the internal IP address of the Server.DONE!If you run into problem with setting up the web server software there is alot of help on the internet. Apache forums, Fedora Forums, this forum... I've always found help with my advanced setting in the web server and what I was just talking about is 50 times easier, so if I can find help on the impossible you can find help on the easy stuff.
  7. Well if we look at thoughs results in all cases you will see that IE is last...where are these timers that you timed this results with, I would like to test pages on the internet... like my old and new layout, along with other websites.I don't want to use an online timer because there answers are way to funky... one site said my site took .01 sec to load on DSL and another said 1min 34 sec on DSL (yeah, you betch-a)
  8. well you learn how to draw really good or If it was me I would use a program like 3DS Max... something like that, were you can draw 3D and the program can pick a sun point and make the shadows look real. It is just a bunch of px, you could use paint if you had the time!
  9. Maybe they work fast!I think the meta tags showed him it wasn't a google person."and that google contacts ever company that has a website and asks them what rank they should be." -- that is so funny.. Well you see google, were just not feeling it to day so drop us down to like 13th... Maybe tomorrow..
  10. I need help telling my brother how google works, he thinks 2000 people look at 500 billion pages and write a summary of each page almost ever hour.He also thinks that scripts can not look at the source or see other webpages... like they can't access them in any way. that a script can't process every page and pick out keywords and give a rank to the page. and that google contacts ever company that has a website and asks them what rank they should be. Then after getting there view on each page go back and write a summary for each page. Then when someone updates a page they do it all over again.To get his view more, I went to google and went to a summary and he said google wrote "This article is about one of the founders of Microsoft." and that it wasn't on the page that the link went to, even though the web site has the same text in the first par.How do I prove that google uses a script to proccess every page (I need to also use stupid logic, nothing to big like "program" or anything)------Also Mac users, if you want to know how brain washed the average windows user is here is a quotes from my brother "Well Macs wouldn't be on the top of [the search term] computers because they a peice of junk!"Now I know what your thinking... put down the gun, it will not make this go away. no matter who you kill... yourself, my brother, the average user, bill, me(don't kill the messager)...
  11. you can right hand click and zoom in if that helps, other wise if you have a larger monitor. I can't really zoom in without having to have it scroll.Well I'm BASICLY done with each part. I still have to do shooting and killing...I have the hero walking done, I still need him to get in and out of cars. I have the car motion test done, trailer motion done. got how the map is going to function.I don't know how the cars are going to load though.
  12. I have a mediawiki on my site...W3Schools could easily have one.. yeah just put you logo and some info and your done.
  13. Well I'm finally posting my script for some help... I had to do alot more work with this tableless thing.. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html><head><meta http-equiv='content-type' content='text/html; charset=UTF-8' /><title>The DCole Server</title><style type='text/css'>body { margin: 10px auto; padding: 0; font-family: verdana, arial, sans-serif; text-align: center; background: #fafafa; color: #000000; }h1, h2, h3 { font-family: verdana, arial, sans-serif; color: #990000; background: transparent; }p { font-family: verdana, arial, sans-serif; color: #000000; background: transparent; } a { color: #990000; background: transparent; font-weight:bold; text-decoration: none;} a:link { color: #990000; background: transparent; } a:visited { color: #990000; background: transparent; font-weight:bold; } a:active { color: #990000; background: transparent; font-weight:bold; } a:hover { color: #990000; background: transparent; font-weight:bold; text-decoration: underline; }#header { margin: 0 auto; padding: 0; width: 700px; height: 150px; text-align: left; background: #fafafa; color: #000000; border-top: 1px solid #000000; border-right: 1px solid #000000; border-bottom: 5px solid #000000; border-left: 1px solid #000000; }#logo { float: left; position:absolute; top:15; font-size: 80px; padding: 25px 0px 0px 15px; }#logod { float: left; top:10; color: #990000; }#logoc { float: middle; top:10; color: #000000; }#tdcs { font-size: 30px; background: transparent; color: #990000; }#title { float: right; position:absolute; top:50; margin: 0px; padding: 25px 0 0 150px; background: transparent; color: #000000; }#titleurl { background: transparent; color: #990000; }#titlefz { color: #000000; } #title h1 { margin: 0; padding: 0; display: block; }#container { margin: 0 auto; padding:0; color: #000000; background: transparent; width: 700px; text-align: left; }h2.section { margin-top: 10px; font-size: 13px; background: transparent; color: #990000; border-bottom: 1px solid #990000; }#sidebar { float: left; width: 140px; padding: 0px 10px 11px 0px; background: transparent; color: #000000; font-size: 12px; }#sidebar p { font-size: 12px; }#divider { float: left; height: 310px; border-left: 1px solid #000000; padding-left: 5px; border-right: 1px solid #000000; }#content { float: left; width: 525px; padding-bottom: 10px; padding-left: 10px; background: transparent; color: #000000; float: right; }h2.date { margin-top: 10px; padding: 2px 5px; font-size: 13px; font-weight: bold; letter-spacing: 0.09em; text-align: left; background: transparent; color: #990000; border-top: 1px solid #000000; border-left: 5px solid #000000; }h3.subject { font-size: 12px; letter-spacing: 0.09em; background: transparent; color: #990000; }div.sig { font-family: verdana, arial, sans-serif; font-size: 12px; text-align: right; padding: 0px 5px 2px 5px; border-bottom: 1px solid #000000; border-right: 5px solid #000000; }#footer { font-family: verdana, arial, sans-serif; font-size: 12px; }#content p { font-size: 12px; margin: 10px 0px 5px 10px; }#credits { float: left; width: 140px; margin: 0px; padding: 5px; background: #fafafa; color: #000000; }input,textarea { background-color:#ffffff; color:#000000; font-size:12px; border:1px #000000 solid; margin: 1px;}</style></head><body><div id='header'> <div id='logo'><div id='logod'>D</div><div id='logoc'>C</div></div><div id='title'> <div id='tdcs'><b>The DCole Server</b></div> <br /><div id='titleurl'><b>http://dcole.ath.cx</b></div> <br /><div id='titlefz'><b>Developing the Web</b></div></div></div><div id='container'><div id='sidebar'><b>[: Home<br />:] <a href='/settings.php'>Settings</a><br />:] <a href='/blog/'>Blog</a><br />:] <a href='/wiki/'>Wiki</a><br />:] <a href='/mb/'>Message Board</a><br />:] <a href='/search/'>Search Engine</a><br />:] <a href='/fm/filemanager.php'>File Manager</a><br />:] <a href='/hosting.php'>Hosting</a><br />:] <a href='/scripts.php'>Scripts</a><br />:] <a href='/support.php'>Support Us</a><br />:] <a href='/cummunities.php'>Communities</a><br /></b><h2 class='section'>Account login!</h2> <form action="/ffm/login.php" method="post"> <div align="left"> Website:</div> <input size="25" name="website" type="text" /><br /> <div align="left"> Password:</div> <input size="25" name="password" type="password" /><br /> <input value="Login" type="submit" /> </form><hr />Updated: 6/15/2006</div><span id='divider'> </span><div id='content'><h2 class='date'>Welcome</h2><p>We provide free website hosting to personal or small businesses. The DCole Server also provides it's own public search engine, scripts, and other tools.</p><div class='sig'><a href='http://dcole.ath.cx/fm/registration.php'>Sign up!</a></div><h2 class='date'>Updates</h2><p> <br /><b>Layout</b> -- As you can see, there is a new layout with vaild xhtml and css. <br /><b>WikiDCole</b> -- This site now as it's own wiki! You can add and find information. <br /><b>New Server</b> -- The Server is now run on Fedora Core 5 <br /><b>New Server</b> -- 3 times faster with twice as much space!</p><div class='sig'> </div><br /><br /><br /><div id='footer'><a href="/aboutus.php">About Us</a> | <a href="/sitemap.php">Site Map</a> | <a href="/terms.php">Terms of Use</a> | <a href="/access.php">Accessibility</a> | <a href="/feedback.php">Send Feedback</a> | <a href="/contactus.php">Contact Us</a></div></div></div></body></html> Can someone help remove the space inbetween "The DCole Server" and "http://dcole.ath.cx" and "Developing the Web"also is there a way to have the divider div auto go to the bottom of the long one of sidebar or content. If I set a border on each side of sidebar and content sometimes they don't match up because div tags can be different heights... unlike TDs.Also can "Updated: 6/15/2006 About Us | Site Map | Terms of Use | Accessibility | Send Feedback | Contact Us " be it's own line but never have the "About us" cross over the divider middle.
  14. Any help well do...With the building and roads I'm drawing them in flash.With the cars, I'm getting them from images, then using a trace function in flash to make them into flash drawings.So if you make any images with another program I can just turn them into flash. I could also just remake the images in flash, taking the ideas in your drawing... this will keep the graphics more equal but give more graphics. It really the idea I'm looking for. Like the inner bend corner that was given earlier in this topic.
  15. dcole.ath.cx

    Eh....

    when you go over it, the script will change the image to a different image...It will only look messed up if you make a messed up button, so it's not my idea that wouldn't work but your drawing...
  16. but the point of adding a wiki would be that anyone could add on to it. so then answers to common questions would have to be written over and over again.
  17. Russia is in both! Most of it is in Asia but most of the population lives in Europe.A company may classify it to what makes them more money.
  18. dcole.ath.cx

    Eh....

    Well you should have you should re post this question in html/xhtml for more help. unless your trying to shadow the thing, which doesn't sound like you asking for.well there are a couple a way that this may work. have the whole thing (all buttons) as one big image them use html map tag with the area tag with shape poly to map out each area then change the big image to one with that button there over being shadowed or with some effect.Another way is to make each button (home, links, forum...) be a button then use z-index or z-axis to layer the buttons over each other and then do the map and area thing again.W3Schools has tutorials on mapping and z-index, everything I talked about.
  19. the span tag would have work too... why did someone suggest that? and why didn't I think of that? *spacks self*Just for this, I'm leaving the computer and going to go eat food!
  20. I changed the map editor a bit and added some requested roads and buildingsMap maker
  21. well stopped working on my html for about 2 months and my php for a month so I'm rusty... just today I looked at some great php I wrote and it took me an hour to understand what I was doing...well with tableless you need to position every little thing... and you have to get the postion just right, with tables it just spacks a border and everthing is ligned up perfect.and why does a div tag include return when you close it... that's like me adding a "qu" button to the keyboard... yeah alot of people use "q" and "u" together but they don't make a button for it... so why should the closing div tag automaticly start a new line.
  22. Does anyone know of a program that will make a tableless site.I'm going to remake my pages to looks like http://dcole.ath.cx but with xhtmlall programs I have used use tables...
  23. boen_robot, I see what your talking about now.. I will make that block soon, along with some buildings.SFB wants the hero.swf walking to walk in the direction that the mouse is, then the left and right would move in 90 of that direction. so it you were pointing at 90*, up would be 90*, left would 180*, right would be 0*, and down would be 270. If you were pointing at 135*, up would be 135*, left would be 225*, right would be 45*, and down would be 315*.although this would make right left and left right when your pointing to the bottom of the screen.Is there a different way anyone wants it, do you want it the way I have it, SFB way or what?
  24. On the map editor the 16,17,18, and 19 images on the 2nd row are road with side walk like the water and sand if that's kinda what your looking for.The map editor blocks are kinda small and hard to find... I'll have to come up with a better way or something! Also, I can't read the maps you are making yet. To keep things simple I just have the black and white blocks.------I've been working on the hero. hero.swf this has it so the you rotate the guy with the mouse and can move him in 4 basic directions with the arrow keys.. I should change it so it has 8 directions.I will have the keys different when you get inside the a car so that you have to be moving to go forward or backward, like in the 2 trailers and hook up files in easier posts, to turn left and right.------how should I put the other cars on the tiles, they will need to be inserted by AS but they need to be moved with one tile... think I can make a beta game there it tell you your X, Y, and angle to make that easier but if someone has a better idea I'm willing to change.
  25. Buildings are missing, I will create some for the editor some time... I really don't know what to do with them. Flat with some squares or something... some that look like houses. What are you thinking of for a one way road? you could have parking and a side walk on some side and a side walk without parking on the other... I may need to see a dough drawing to see what your thinking of...mine was like||//__||||//__||||//__||||//__||with __ because multiple space get ereased.
×
×
  • Create New...