The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.39 / 5.00 38,635 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 15,161 Viewspost your code I'll look at it.
ok first time i checked out that link and it runs pretty fast accually haha only runs slow in flash. sweet! still gaps are sort of visible.
so anyway I was lazy and finally did it, my problems are that there is a gap between the tiles which shouldn't be there, and the speed,
as far as speed goes I tried "not moveing" the tiles off screen but it didn't seem to help at all. maybe my concept is way off in the code there.
here is the link (arrow keys scroll the map):
http://media.putfile.com/ISO---SCROLL-1
code is all in one MC:
onClipEvent(load) {
map_tilex = new Array();
map_tiley = new Array();
camerax = 0;
cameray = 0;
camerax_mod = 0;
cameray_mod = 0;
var mapflip = 0;
for(y=0;y<16;y++) {
for(x=0;x<16;x++) {
_root.floor1.duplicateMovieClip("floor1"+x
+(y*5), x+(y*5));
_root["floor1"+x+(y*5)]._x = x*256+(128*mapflip);
_root["floor1"+x+(y*5)]._y = y*64;
map_tilex[x+(y*5)] = x*256+(128*mapflip);
map_tiley[x+(y*5)] = y*64;
}
if (mapflip == 0) {
mapflip = 1;
} else if (mapflip == 1) {
mapflip = 0;
}
}
}
onClipEvent(enterFrame) {
if (Key.isDown(Key.LEFT)) {
cameraxmod = 5;
} else if (Key.isDown(Key.RIGHT)) {
cameraxmod = -5;
}
if (Key.isDown(Key.UP)) {
cameraymod = 5;
} else if (Key.isDown(Key.DOWN)) {
cameraymod = -5;
}
if (cameraxmod > 0) {
cameraxmod -= 1;
} else if (cameraxmod < 0) {
cameraxmod += 1;
}
if (cameraymod > 0) {
cameraymod -= 1;
} else if (cameraymod < 0) {
cameraymod += 1;
}
var mapflip = 0;
for(y=0;y<16;y++) {
for(x=0;x<16;x++) {
if (map_tilex[x+(y*5)]+camerax > -256 and map_tilex[(y*5)]+camerax < 550+256) {
if (map_tiley[x+(y*5)]+cameray > -128 and map_tiley[(y*5)]+cameray < 400+128) {
_root["floor1"+x+(y*5)]._x = map_tilex[x+(y*5)]+camerax;
_root["floor1"+x+(y*5)]._y = map_tiley[x+(y*5)]+cameray;
}
}
}
if (mapflip == 0) {
mapflip = 1;
} else if (mapflip == 1) {
mapflip = 0;
}
}
camerax += cameraxmod;
cameray += cameraymod;
}
owning this site must be a pain sometimes lol, but thanks for supporting awsome flash games! you guys rule and thanks for the help too!
I want to start working on an isometric scroller type engine, just like Desert Strike? or urban strike, you know old snes sega blah blah.
anyway I just wanted to know if anyones done this before and had any problems I might want to watch out for or advice, it seems pretty simple to me but maybe theres some aspect I'm not considering.
also I've had problems with tiles lineing up before, small gaps or overlaps, is there an easy and efficient way to deal with this problem?
3D = 3 dimentions = X Y and Z coordinates
onClipEvent(load) {
// INIT //
// DOT POSITIONS IN WHOLE NUMBERS EXCEPT FOR Z //
dotx = new Array();
doty = new Array();
dotz = new Array();
// CAMERA VARS //
camerax = 0;
cameray = 0;
cameraz = 0;
// INIT (DOT LOCATIONS IN GRID PATTERN (SAME Z VALUE) //
dotnum = 99
for(dy=0;dy<=5;dy++) {
for(dx=0;dx<=5;dx++) {
dotx[(dy*10)+dx] = dx;
doty[(dy*10)+dx] = dy;
dotz[(dy*10)+dx] = 1;
}
}
// DUPLICATE THE DOTS //
for(a=0;a<=dotnum;a++) {
_root.dot.duplicateMovieClip("dot"+a, a);
}
}
//////////
// MAIN //
onClipEvent(enterFrame) {
// UPDATE DISPLAY //
for(b=0;b<=dotnum;b++) {
_root["dot"+b]._x = ((dotx[b]*10)+camerax)*(dotz[b]+cameraz);
_root["dot"+b]._y = ((doty[b]*10)+cameray)*(dotz[b]+cameraz);
_root["dot"+b]._xscale = 100*(dotz[b]+cameraz);
_root["dot"+b]._yscale = 100*(dotz[b]+cameraz);
}
////////////////
// USER INPUT //
if (Key.isDown(Key.LEFT)) {
camerax += 1;
} else if (Key.isDown(Key.RIGHT)) {
camerax -= 1;
}
if (Key.isDown(Key.UP)) {
cameray += 1;
} else if (Key.isDown(Key.DOWN)) {
cameray -= 1;
}
if(Key.isDown(Key.PGUP)) {
cameraz += .1;
} else if (Key.isDown(Key.PGDN)) {
cameraz -= .1;
}
}
http://media.putfile.com/3dtest1
example... not the best but something I came up with in a couple of minutes. sorry about the arrays if you don't get them... read a tutorial.
controls: up down right left and page up/page down are the zoom keys
so the values in the code coule be anything for the xyz (stored in the three arrays) locations dotx[] doty[] doty[]
haha all you need to do is move them correctly. i could get the angle action happening on the XY axis but i figure you'd just use the XZ axis the same way no?
you know
dotx[] += math.sin(ROTATION*(MATH.PI/180))*1
doty[] += math.cos(ROTATION*(MATH.PI/180))*1
that kinda thing but with dotz[] maybe tan I have no idea, if you know tell me lol. code is in it's own MC called "control" and the dot is a seperate MC called "dot"
simple and it works.
haha i love the baby shake dunno why looks cool funny also
I'll hit the keys as soon as I see a working area with test bots doing random actions
...AND...
serious documentation!!!!!!!! explaining every action how the arena works in DETAIL, this won't work untill someone does this. it won't be hard at all for someone to code, I've coded this exact thing 4 million times and it's not that hard and it doesn't take long if you don't have to code the ai.
the code for the ai should be in one MC
all the information the bot can sense should be PASSED into the mc
all the actions the bot can do in a frame should be RETURNED
if you don't understand passing then you should not code this.
ok heres one thats harder...
1) make a projection of text useing dots, like take your alias and make it scroll in dots, like on one of those signs.
or
2) useing the projected dots add the z axis and make it 3D
3) or scrap all that and make a 3d plain by duplicateing a dot mc.
not very impressive I know, maybe I'll hit the text one up sounds like fun.
i was going to make the particles "throw" off the mouse but ehh
mouse stupid thing easy.
hahaha, sorry just had to say thats hillarious.
but honestly... it did suck anyway... he was doing you a favor in a way. put it out of it's misery.
flash 8... google... type... think.
he's asking how you would go about building the logic of a tetris game, and I honestly am afraid to touch it since it's been done so much I'm sure someone would have an awsome algorithm for this.
but how would I do it?
I disgregarde the empty "squares" since they don't really exist. I hope that helps, you'll have to do the code on your own. It will run alot faster that way.
oh man also sorry dp,
I didn't see that code advice, thanks but I laugh at that! HA
you should see some of my code, even I can't read it or understand it, thats how good it is!
anyway the link was posed by numbers above. that is all. the new on is V4
lol you win if you beat the depth limit. I was going to code that but since I didn't see a problem yet I let it slide, thanks for that one.
and secondly I do clean up after myself just because it would run so slow if i didn't that would suck ballz.
and thirdly I for mr numbers recoded the RTS engine today haha all that plus my 8 hours of work. these manic manic days... anyway, fixed up the code on the rts MAJORLY flash 8 is so much better... luckily there is AS MAIN lol saved me more then a few lines! I forget who did the tut on useing the Math.atan(Xd,Yd), but thats a crapload.
who needs sleep when you have pepsi and coffee and sugar.
that was like 3 lines and I was doing it before in like 10-12 I think, don't even ask... ah anyway maybe I'll finish these, could be better to go back and forth between them so I don't get bored...
yeah thats all well and good but how would you do it?
i'm useing a touchpad heh, any I'm old. thats why everything is keyboard with me. yeah thats a great idea, a toggle between keys and mouse. easy.
ahh I'll try loading it in 8. unfortunatly I'll have about 0 time this weekend because I have to train a newb dounut fabrication technician in the deadly art of makeing sugar/fat based pastry.
No, no nessicarily, I mean the engine is dead for sure, it's coded in flash 5, and I just got 8. Also it's full of so many bugs, they really showed their heads when I tried to impliment the unit selection, major logical flaw in my thinking.
I've learned alot from that engine, and I know I can do it, it just eats the crap out of my time. it just needs to be rebuilt from the bottom up. I didn't know you were still interested. I can rebuild, I have all my models, which are tottally unnessicary... all i need to do is code the whole damn thing with placeholder graphics.
also any money that I could get for a game like that would be so little compared to the time put into it, code graphics music sound, I mean just the graphics man, hours and hours... lol, but yet I still want to see a REAL RTS in flash. my dream is not dead, it's just in intensive care right now.
So anyways, other then bakeing donuts all day this is what I'm doing right now...
not to much, hopefully I will be able to finish this one.
CONTROLS:
UP ARROW- accelerate
DOWN ARROW- decelerate/reverse
RIGHT ARROW- turn right
LEFT ARROW- turn left
A - turret rotate right
D - tuttet rotate left
SPACE - fire
CONTROL - switch weapon
http://media.putfile..NEW---Tank-Engine-V1
you can only really see a differance in the way a shot moves or how far it goes etc. as graphics are something I havn't even started yet.
basic tank shoot engine, with enemy's implimented with simple AI, collision detection not even started, but features so far:
- 4 different weapon types (normal, machine gun, big round, and duel shot)
- All stats customizeable for all units, enemies and player (ie. acceleration, max speed, health, cash none hard coded)
- AI is really stupid (will not always turn the most effiecient direction haha) but will drive towards the player in a kamazi attack.
- really crappy art (it's symbolic at this point ok??)
anyway far from complete but I'd like to hear some cool ideas of what to impliment. other then the ones I have, or if you like my ideas I'd like to know too.
planned addings:
- more weapon types (rockets, missles, grenades...)
- better AI, corrected effiecentcy in movement, planned waypoints (planning ahead), turret aiming and fireing
- armor types, such as a machine gun bullet would not penitrate heavier types of armor, while a high velocity shell from a tank could etc.
- many many upgrades even stupid usless ones that just make your tank look sweet
- more enemies...
- more driveable vehicles, maybe build your own, we'll see. I want to fly around a hind and blow up some tanks.
- scrollable map. possibly very big maps, not sure how I want to do it... maybe screen at a time, since I can never seem to get a smooth enough screen "glide" around my maps in real time.
- accual mission to bring a point to the game.
anyway bad idea? good idea? any ideas? very much appritiated.
yeah but they also always have to face the turret! think about that part also.
it's the basic engine man, of course there is no upgrades, but the code is functioning properly and thats awsome. I agree faster bullets, or the ability to speed them up would be sweet. I think he had that in mind anyway tho.
looks like your off to a good start, I can easily put enemies in for you if you want, all I need is the file. All i would do is put in the code and a default mc like a circle and have them come at you from the outside.
or I can just tell you how I would do it. whatever you want to do.
this does look way to similar to another game I played though, if you submit it make sure you put something extra and above the one before it.
uh oh sounds scarey lol, well show me what you have, upload it to image shack or whatever so I can see how it works, or send me the file. That shouldn't be a hard function to code, I'm bored. fryerdrew@hotmail.com
post your code. I'll do it for you if it's easy.
how about army style rankings. you know the badges batches medals etc, but modified to suit your need.
get lightwave! i recomend that, and just render your 3d images.
man that is so offensive... i think it will definatly work.
lol makes you wonder..