You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!

Author Search Results: 'TheBoob'

We found 386 matches.


<< < > >>

Viewing 1-30 of 386 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 91113

1.

None

Topic: flash v-sync, AHH

Posted: 11/17/09 09:46 AM

Forum: Flash

So as im sure any good game developer knows, flash screen tearing is a horible thing. I think i get the basics behind why it happens, simply flash not taking advantage of the hardware on your computer and refreshing the frame at different speeds than your computers refresh rate. My question to the people out there whom are smarter than me is:

I know its impossible to get rid of it, but is there any good rule of thumb to help limit it. If i have a big object that has to scroll across the screen, is there any way to do it in a way that flash may limit tearing?

I don't have much experience with this problem, but i figure someone out there must have struggled through this before, any input is apreciated.


2.

None

Topic: Translucency in Embedded Flash?

Posted: 11/16/09 12:16 AM

Forum: Flash

As far as your first question, maybe im just not understanding correctly, but if you want something to stay at the top of the screen and not scroll, you can use the css style position:fixed.

Then to make it seethrough, you can use the param wmode=transparent. wmode is pretty sticky stuff and i know on lots of older browsers it dosn't work (and i think even on some newer ones too).

Here is my example (obviously VERY simple, but should show what i mean), to show what it looks like. I think i understood your question, but maybe im way off, haha.

http://www.willinthecold.com/scrollexamp le/help.html


3.

None

Topic: linking a variable to Alpha effect

Posted: 11/15/09 11:45 PM

Forum: Flash

every MovieClip has an alpha variable that controls the alpha value of that MovieClip. In AS3 it ranges from 0-1 and in AS2 i believe it ranges from 0-100.

simply do something like this:

if the action is on the movieclip or in the class
alpha = myVar;

if the action is on the timeline or in another class refrencing to this MovieClip
myMC.apha = myVar

If you are using as2 it should be _alpha instead of alpha.


4.

None

Topic: How to change frame

Posted: 11/14/09 11:45 PM

Forum: Flash

sorry, i need to clarify:

the peice of code:
MovieClip(root).gotoAndStop(#)

This code has to come AFTER this child has been added to the stage. If you are using this peice of code in your class as you are initializing it (which you do before you add the child to the stage) it obvoiusly wont work.

try making a function and calling the gotoandstop with this function right after it has been added to the stage.

so:
var char:Char = new Char(stage);
addChild(char)
char.gotoFunction();

and then your gotoFunction() would just be:
public function gotoFunction():void{
MovieClip(root).gotoAndStop(#);
}


5.

None

Topic: How to change frame

Posted: 11/14/09 11:38 PM

Forum: Flash

I think he is asking if:

var player:Player = new Player(stage);

comes before you do:

addChild(player)

**or however you add your player to the stage.

if you define the player before he is added to the stage, he will not be able to call back to the root with MovieClip(root).


6.

None

Topic: How to change frame

Posted: 11/14/09 06:22 PM

Forum: Flash

Hey, just was testing out some stuff cause i was currious, this looks like it works perfect! I dont know the lagistics behind this, or if this is smart to do or not, but it does seem to work.

MovieClip(root).gotoAndStop(#);

7.

None

Topic: How to change frame

Posted: 11/14/09 05:38 PM

Forum: Flash

Whatever you are creating on the timeline should just have a refrence to the timeline sent in.

So like if you create the GameFrame on the timeline, send it in then, then make myParent static and you can then call it from anywhere.

Msg me on AIM if you want to talk fruther, i think it would be much easier than going back and forth on the forums.


8.

None

Topic: How to change frame

Posted: 11/14/09 05:17 PM

Forum: Flash

Im pretty sure he is working in as3 (as i saw another post of his with as3 code), i forgot to mention that though, so my code is ment for as3.


9.

None

Topic: How to change frame

Posted: 11/14/09 05:15 PM

Forum: Flash

I would recomend passing in a refrence like you did your stageref in that as3 example you posted, so like:

//on your timeline or whatever
var myChar:Char = new Char(this);   //this being the main timeline

//then in the character class i would put
private var myParent:MovieClip;
public function Char(sentParent:MovieClip):void{
myParent = sentParent;
}
private function changeFrame(frameNum:int):void{
myParent.gotoAndStop(frameNum);
}

Your other option is to fire a custom event, and on the timeline wait for that event and respond to it with a gotoandplay function. this is a little more complicated, but i think is a fair amount "slicker".


10.

None

Topic: As2 To As3?

Posted: 11/14/09 05:10 PM

Forum: Flash

lol, our codes are so similar it sorta is disturbing, haha.

Obiously mine is ment for the main timeline, and bcap's is ment to be in its own package. Either way you should be able to use these to write your own code and figure out how its working.


11.

None

Topic: As2 To As3?

Posted: 11/14/09 05:01 PM

Forum: Flash

oh, my fault, this uses the asdw keys to move, change to arrow keycodes to make it use arrow keys.

forgot to mention that


12.

None

Topic: As2 To As3?

Posted: 11/14/09 04:59 PM

Forum: Flash

There are many ways to do this, but to keep it simple, i would just do this code on the timeline **typing quick, so if there is a mistype im sorry**

var power:Number = 0.3;
var ySpeed:Number = 0;
var xSpeed:Number = 0;
var friction:Number = 0.95;
var gravity:Number = 0.1;
var thrust:Number  = 0.75;
var wind:Number = 0.09;

var moveRight:Boolean = false;
var moveLeft:Boolean = false;
var moveUp:Boolean = false;
var moveDown:Boolean = false;

stage.addEventListener(KeyboardEvent.KEY_DOWN, keyPressedDown);
stage.addEventListener(KeyboardEvent.KEY_UP, keyPressedUp);

function keyPressedDown(e:KeyboardEvent):void{
if(e.keyCode == 65){
moveLeft = true;
}else if(e.keyCode == 68){
moveRight = true;
}else if(e.keyCode == 83){
moveDown = true;
}else if(e.keyCode == 87){
moveUp = true;
}
}
function keyPressedUp(e:KeyboardEvent):void{
if(e.keyCode == 65){
moveLeft = false;
}else if(e.keyCode == 68){
moveRight = false;
}else if(e.keyCode == 83){
moveDown = false;
}else if(e.keyCode == 87){
moveUp = false;
}
}

addEventListener(Event.ENTER_FRAME, playGame);
function playGame(e:Event):void{

if(moveLeft) xSpeed -= power;
if(moveRight)xSpeed += power;
if(moveUp)ySpeed -= power * thrust;
if(moveDown)ySpeed += power * thrust;

xSpeed += wind;
xSpeed *= friction;
ySpeed += gravity;
char.y += ySpeed;
char.x += xSpeed;
}

There are obviously many many ways to do this type of code, but this is how i would tackle your literal transation of the code you provided. This could would go on the timeline, and obviously couldn't go in its own class cause i didn't declare any fo the vars private or public. I also asume you have a "char" on the stage to adjust its x and y positions.

If there are mistypes im sorry, but its a lot to type in a small little box, haha


13.

None

Topic: Null Object Reference... Again

Posted: 11/13/09 08:33 PM

Forum: Flash

Im pretty sure those functions arn't nested, they are just tabbed in a weird way, and then there is an extra } at the end (probably from his class opening or something).

I believe your error is probably the fact that you are trying to call stage, but if the class you are calling these functions from hasn't been added to the stage yet itself, it can not refrence stage.

Thats just a guess though, as i would need to see the rest of the code to be sure.


14.

None

Topic: Action Script help

Posted: 11/12/09 10:33 PM

Forum: Flash

This is a very common problem, what is happening is your code on your timeline runs one time (right when it gets there) and then doesn't run any more after that. You have to make sure that your timeline code is running every frame. you can either do that by moving it to a movie clip, or using this code on your timeline:

my as2 is very rusty so sorry if i mistype this, you can probalby look it up pretty easy

this.onEnterFrame = function () {
    //your hit test code here
}

15.

None

Topic: Issues with a tower defence

Posted: 11/11/09 11:06 PM

Forum: Flash

I havn't used AS2 in a long while, but how i normally tackle this problem in as3 (which should work in as2 as well) is you create an empty movieclip, add it to the stage, then add your swatter on top of that. Then every time you create an enemy, instead of creating it on the root, you create it in the empty movie clip. This way it goes on the highest depth in the movie clip (wich means its still below the swatter).

Your other option is to stack the depth negativly, which means that as the numbers go more and more negative they stack DOWN (and the swatter stays on top). Ive heard this option is bad to practice, but i dont know much about it other than it could work for you.


16.

None

Topic: Custom Events With The Api?

Posted: 11/11/09 06:45 PM

Forum: Flash

There is no way currently to track custom events, as of right now, i dont even know if they are being recorded. I know they are working on it and should have it "soon"


17.

None

Topic: Mochi Score Board Help, please...

Posted: 11/09/09 10:40 PM

Forum: Flash

I have never used the Mochi highscore board before. I dont know if this will fix all your problems but i would try to fix that error that is getting throw before you move onto anything else.

By looking at the url it gives:
'http://x.mochiads.com/com/4/undefined.s wf'

you can obviously tell that it isn't searching for /4/undefined.swf, its lookinf for a variable that is undefined in your code somewhere. I would recomend trying to look for where that variable is not getting defined, and try to fix that.

Like i said, i have never used the mochi scoreboard before, but i hope this helps you get started.


18.

None

Topic: [AS2] Why is this crashing?

Posted: 11/09/09 09:21 PM

Forum: Flash

//your function
function bonusMovement(){
	for(i = bonuspt.length - 1; i >= 0; i--){
		bonusptA[i]._y += 3*yspeed/2;
		if(bonusptA[i]._y >= 600){
			bonusptA[i].removeMovieClip();
			bonusptA.splice(i,1);
		}
	}
}

i think you ment to do:

//you missed the A
for(i = bonusptA.length - 1; i >= 0; i--){

this does cause it to crash im pretty sure


19.

None

Topic: Best practice when creating game?

Posted: 11/09/09 05:04 PM

Forum: Flash

You are talking about learning OOP (Object Oriented Programming). At first i really didn't like the idea, but after jumping in head first, its AMAIZING how much it helps you organize your code. I would look for some tutorials on line, to get the basics.

but essentialy what it means, is that you can create your own objects (classes), then use these classes throughout your game.

IE: you can make an enemie class, and give it all the needed variables and such (thinks like speed, attack power, etc) and any time you want a new bad guy, you can create a new one with one line (or maybe a few lines) in the same way you create a new array or object.

I wish i rememberd the tutorials i read through when learning, but unfortunatly i dont, im sure there is some good stuff in as:main though.


20.

None

Topic: (AS3) Type Coercion failed

Posted: 11/09/09 02:43 PM

Forum: Flash

I think i understand your question, but i could be mistaken.

Lets say you have a function, that you apply to an enter frame event, and you want to apply it to multiple movie clips, and you want each movieclip to work slightly different based on a variable.

I wouldn't normaly do it like this, i would normaly program it into the class, but this might help you understand.

first we add the event to the movie clips

mc1.addEventListener(Event.ENTER_FRAME, myF);
mc2.addEventListener(Event.ENTER_FRAME, myF);

//to make these function differently, we will add a variable to them
mc1.speed = 10;
mc2.speed = 3;

//here is the function that you will use
function myF(e:MouseEvent):void{
var mySpeed:int = e.data.speed
x += mySpeed;
}

I may be going way off track here, but i think this is what you were asking (also, i typed the code fast, so it might have some errors)


21.

None

Topic: Changing Arrays, on a mass scale

Posted: 11/09/09 02:08 PM

Forum: Flash

Well, if you want to modify all the variables (ie, current value += 10) then you could do it with a for loop, but if you are trying to give all all new values to each one, its probably best to do it on each line.

for(var i:int = 0; i < myArray.length; i++){
myArray[i] += whatever
//or
myArray[i] *= whatever
//or pretty much anything.
}

myArray[i] represents each value of the array, you could even do something like:

//in the for loop
myArray[i] = i;

which would set the array to 0, 1, 2, 3.... etc.

Hope this helps


22.

None

Topic: (AS3) Type Coercion failed

Posted: 11/09/09 12:56 PM

Forum: Flash

Thats how it should be, but im guessing that his class extends movieclip so it probably does't throw an error. but i definitely could be wrong.


23.

None

Topic: pingpong simple AI

Posted: 11/09/09 02:13 AM

Forum: Flash

Its hard to give you exact code in these situations as it all depends on your structure (which you cant really post). essentialy you have to think of it like this, if you put code on the timeline, you call everything directly from there, so from the timeline, its just ball, or paddle, or AI. If you are then programming on AI, and want to call to ball, you have to call back to the timeline, and then call ball.

I could take a look at your fla file (i have cs3) but i dont use as2 anymore, so i dont know how super helpfull i would be.


24.

None

Topic: Need some help with programing this

Posted: 11/09/09 12:02 AM

Forum: Flash

The best way to do this is with a database and programming language, like mysql and php. To get startd i would look up phpMyAdmin, its an amaizing tool to learn how to database (but it can teach you some bad habbits too, haha).


25.

None

Topic: (AS3) Type Coercion failed

Posted: 11/08/09 07:57 PM

Forum: Flash

I think you want to change:

e.target.removeChild(MovieClip);
//to
removeChild(e.target);

when you do removeChild(MovieClip) you are trying to remove the class MovieClip (which is well, it just doesn't make sense, you cant display a class, you can display an instance of a class).

I read through your code real fast, so i dont know if this is the only problem, but fix this and then give it a whirl.


26.

None

Topic: pingpong simple AI

Posted: 11/08/09 07:53 PM

Forum: Flash

Im going to guess at this mistake, but obviously depending on your structure, i could be wrong.

normaly ball is NOT inside your current movieclip (which is the bad guy) so you have to refer to the ball itself, something like:

_root.ball
//or
_parent.ball

when you just call ball, it searches for the ball inside the current clip, its the same as doing this.ball or something. look at your structure, and hopefully this will point you in the right direction.


27.

None

Topic: what did behemoth use to make games

Posted: 11/07/09 10:49 PM

Forum: Flash

They used a flash emulator on the xbox for the first 2 games, for game3 they are going strait C++


28.

None

Topic: AS3 rollover

Posted: 11/07/09 10:25 PM

Forum: Flash

to make a simple button in as3 is easy (although not as straitforward as as1 and as2).

timeline code

//first we make a function
function functionName(e:MouseEvent):void{
//make the function do whatever you want
trace('it worked');
}

//now we attack the function to our button on a CLICK event
buttonInstance.addEventListener(MouseEvent.CLICK, functionName);

A few things to note, lots of people will organize their code differently, but to me this is the easiest way to explain it. You can add all the event listeners in one section, and set up all the functions in another (you dont have to put the functions before you add it).

You can play around with all the different MouseEvents to get the right effect, some of the posible options are:

DOUBLE_CLICK
ROLL_OVER
ROLL_OUT
MOUSE_UP
MOUSE_DOWN

etc

I think this is what you were asking, good luck


29.

None

Topic: Timer Seconds

Posted: 11/06/09 11:43 PM

Forum: Flash

One thing i have noticed in my time making flash, is its not good to mix timers and enter frame effects. (this is just my opinion)

I would either recommend using timers for EVERYTHING or enterframe events for EVERYTHING. When you use only one, everything is linked together, so computer speed doesn't effect ability to preform a task.

If you want my personal opinion, i like making games with enterframe events for everything, because if you computer lags it does not hinder your ability to play the game (as much as if you do it the other way).


30.

None

Topic: Actionsript not working

Posted: 11/06/09 11:09 PM

Forum: Flash

Its hard to say for sure, but one thing to definatly check, is when you put actions on a button, those actions only work for that keyframe (and the non keyframes after it). I see in the example it apears the button disapears after that kefyrame, but if you tried to click that button before it got to that frame (if its on the timeline) it would simply not do anything.

just make sure the code is on the button, and the button is on its own layer that spans the total distance you want the button visible.

Also, scenes do act funny when it comes to gotoAnd functions.


All times are Eastern Standard Time (GMT -5) | Current Time: 04:02 PM

<< < > >>

Viewing 1-30 of 386 matches. 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 91113