RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (Full Version)

All Forums >> [Gaming Community] >> [Legends and Lore] >> Artists of Legend >> Art Academy



Message


iEnd -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (5/20/2009 6:42:49)

I am making a point and click movement system...
All I got this fa ris this code:
onClipEvent (load) {
	_x = 0;
	_y = 0;
	speed = 5;
}
onClipEvent (mouseDown) {
	endX = _root._xmouse;
    endY = _root._ymouse;
}
onClipEvent (enterFrame) {
	_x += (endX-_x)/speed;
	_y += (endY-_y)/speed;
}


The code is on the MC.
Now I want my guy to rotate facing the point I click, like on DF or any other AE games...
Can ya help me?




somebody621 -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (5/20/2009 14:57:29)

First of all, it's a good coding habit to put all the code on one frame =).
To solve your problem, if the endX is greater than the _x, make it face right (gotoandplay or scaleX = -100 or something like that). if endX < _x, make him face left.




MegaPoster404 -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (5/20/2009 15:37:38)

How can I make a movieclip rotate to face the mouse? I want to make a tower defense, and I'd like the tower to face the mouse.




biG frend -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (5/20/2009 17:08:20)

If your talking about 360 degree rotation I know its fairly complicated and involves some pretty pretty hard math functions.
Sorry I couldnt help anymore. I'd show you my own one but uhh new hard-drive sucks.




somebody621 -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (5/20/2009 20:45:24)

Actually, Math.Atan2(y, x) returns the angle in radians.




flsg -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (5/27/2009 16:22:08)

I always miss the chance to answer to the questions x.x...
need to get on here more often lol




darksideofthefarm -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (5/29/2009 13:30:57)

Hey, im trying to code an inventory for an rpg, I can't seem to figure out the code (I need help on a DF like Inventory, I know how to make the other kind) Like you get a weapon from a quest then add it to your inventory and shop etc. But I can't seem to edit this into a more DF like inventory script. Also how do I make the inventory pop up, then hide when I click an X button, so like its hiding then appears?

Code Im trying to edit and build upon. Maybe I need a new code

currentslotnum = 1; 
stop (); 
function addToslot (item) { 
if (!item.found) { 
item._x = eval ("itemSlot" + currentslotnum)._x; 
item._y = eval ("itemSlot" + currentslotnum)._y; 
item.found = true; 
currentslotnum++; 
} 
} 

onClipEvent (enterFrame) { 
if (_root.character.hitTest (this)) { 
_root.addToslot (this); 
} 
}




EragonZZZZ -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (5/30/2009 15:56:32)

Raycasting Fun!

Woohoo! Drag the white dots and click where ever suits your fancy.




zaffie252 -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/2/2009 7:16:09)

hey im trying to code a game where you control a ship with your mouse and you need to dodge asteroids(much like the mq minigame)
i know how to make the ship follow mouse and i can do hittests. i just need to know how to make the asteroids fly to the left at different speeds.
any help will be appreciated
thanks




~JW~ -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/2/2009 10:28:53)

I Am Using Flash 8. I Heard About Tweening. What Is This? How Do I Do It? Because I Only Do Frame By Frame.




//.Shadow.\\ -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/2/2009 11:16:56)

Easy you have your frame by frame still but all you do on the frames is right click and then Create Tween. I suggest layering differnet items incase you make mistakes then you can easly go back.
//.Shadow.\\




biG frend -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/2/2009 11:54:18)

zaffie252 thats easy, draw your meteor, make it a movieclip and inside the movieclip make a second keyframe say on frame number 30 or w/e and move your asteroid over to the left and make a tween.

Then on your frame use the attachMovie command to put the movieclip on the stage.
If your unsure how to use attachMovie, heres my quick rundown.

_root.attachMovie("LinkageName", "Instancename", Depth)
_root["Instancename"]._x = NumberGoesHere
_root["instancename"]._y = Number goes here

A linkage name can be assigned to a symbol either when you first hit f8 by clicking export for actionscript or you can go to the library right click your symbol and hit rename or something similar. What instance name you give it is up to you, when your coding your hit.test you'll be hit.testing against that instance name. The Depth is a number, it needs to be a unique number it basically works like layers but using actionscript. An object with the Depth of 1 will show over anything, an object with the depth of 5 will show above anything less than 5.
The second part of the code should be pretty self explanatory, no?




~JW~ -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/4/2009 23:21:55)

OK, Im Trying To Do My Own Little Minigame WIth Accoutns And Stuff, How Do I Do A HitTest. Im Using AS2. Im trying To Make A Maze You Have To Go Through, What Do I Do.
For the Registration, Im Gonna Do Something So That It Sends The Details To An Email, Whats the Code.




Vampire and Human -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/6/2009 14:11:56)

Ummm... Here:

ambitions = 9000

if(ambitions >= 9000){
trace("It's over 9000!")
trace("try something simpler")
jw.unexperienced = true
}
if(jw.unexperienced){
jw.shouldtrydifficultylevel = "basic"
}


Gah its contagious....
Anyways, no, thats not the proper code, but try it anyways.

If you can't to hitTest, you most certainly cannot do something with "...Accoutns And Stuff,..." Try for something simpler, like a onetime maze-game. Not everything needs accounts. Simple things amuse simple minds, A.K.A 1/2 of population :3.

Btw, please do NOT copy this code, even though you're probably going to anyways regardless of what I tell you. This is for learning purposes only, and will not really function properly.

if(thingy.hitTest(otherthingy)){
dosomething()
makevariable = "something"
numbervalue = 1337
trace("BLAHBLAHBLAH")
}


What it means is, if thingy one hitTests/touches the otherthingy, it does... something. Pretty much anything you want. Super simple. Nothing to it, really.

Edit: WAIT WAIT WAIt WAit Wait wait wait wait wait wait wait waaaiiittttuh,.... Since when did minigames have accounts? Que? Mah? What? Was? Che? Hva ?




~JW~ -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/6/2009 16:05:48)

Thanx Beef. But Im Not As bad As Everyone Thinks. I Can Do Stuff Like Engines. But...For The Minigame Account Thing, Its Blob Wars...But Ive Made A Minigame For It.




Vampire and Human -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/6/2009 18:05:49)

Umm.... Engines? Que? Mah? What? Was? Che? Hva?




~JW~ -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/7/2009 12:31:50)

Tiganti! Game Engines. Login Walkaround, Battles.




darksideofthefarm -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/8/2009 15:05:54)

Beef: Funny coding. That gave me a good laugh.

JW: Battles and walkaround are pretty simple codes. As for hit tests, how could you script battles without knowing how to do hit Tests (atleast I use hit tests for battle systems) But hey don't worry everyone has to start somewhere.

Eh, I'm bored so I'm gonna do some flash, but hey can anyone help me with an inventory system like DF? I would love you long time if you can help me.




golden rod -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/11/2009 16:06:39)

i'm using flash 8 pro

does anyone know how to make a real time battle system in flash? similar to WoW or AQW. a little simpler then WoW, but a bit more complicated then AQW.




biG frend -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/12/2009 11:35:42)

If you wanted a real 'real time battle system' like an action game etc I'd just have keys assigned that when pressed does the moves action and checks if the weapon your carrying hit.tests the enemy and then have some formulae for damage.




jiggibidy -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/15/2009 5:11:21)

I'm working on some formulae for a quick something I'm working on.
I've got one of the formulae here, and there's supposedly some errors with it.
Here's my code:
on(press){
	if(FireLevel > 1){
		if(PlayerMP >= 10){
			EnemyHP = ((random(5) + 5) * (1 + (Power / 20)))
			if(FireLevel = 2){
				FireExperience = FireExperience + 2
			}else{
				FireExperience = FireExperience + 1
			}
		}else{
			trace (You have insufficient MP)
		}
	}else{
		trace (Your Fire Level is too low.)
	}
}

And here's the error report I'm given:
Error Report

I understand what it's trying to tell me, but I'm at a loss as to how to fix it.
If you could give me the correct format of code, that would be much appreciated, and after that, hopefully I won't be seeing these errors again any time soon.

~Toodles.




~JW~ -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/15/2009 10:27:45)

on(press){
if(FireLevel > 1){
if(PlayerMP >= 10){
EnemyHP = ((random(5) + 5) * (1 + (Power / 20)))
if(FireLevel = 2){
FireExperience = FireExperience + 2
}else{
FireExperience = FireExperience + 1
}
}else{
trace "You have insufficient MP"
}
if }else{
trace 'Your Fire Level is too low.'
}

That Might Work, But Make Sure To Format It. How Do YOu Guys Make The Code Seem Like Its Real?




jiggibidy -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/15/2009 10:38:05)

Never mind, I found out that I used the trace command wrong.
/facepalm.

Also, ~JW~, use the [code][/code] tags, and put your code inbetween them.

~Toodles.




golden rod -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/15/2009 16:03:51)

@biG friend what if i'm not using keys and i'm using buttons. would it still work? also how would i make it so the user can move around the buttons, from a kind of skill book to the .... action bar/ where active skills go.




~JW~ -> RE: Flash Q&A Thread 5 - Flash Sold Its Shares In Your Soul... Recession (6/18/2009 10:42:28)

Im guessing that you need a button battle like AQWorlds?
Well make the buttons, have little pictures on them.
Then make the different frames of him attacking. On
the end of each attack on the frame have this code:
stop();

Once youve done that, make the blade hitTest the enemy. (Thanx for the code beefstew)
if(thingy.hitTest(otherthingy)){
dosomething()
makevariable = "something"
numbervalue = 1337
trace("BLAHBLAHBLAH")
}

Finally, get the number for the frames of attacking, and add this code to the buttons:
on (press) {
	gotoandplay(framenumber)
}




Page: <<   < prev  14 15 16 [17] 18   next >   >>

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition
0.1875