Carr77
262 posts
|
Topic: Game Programming /
Hittest a class?
Originally posted by BraydenBlack:
Ok… so how do I make this work?
I put the code in the frame…
But what do I name the ground?
How do I like… make so the ground is in the array?
Because just putting the code in the frame did not work xD
|
|
|
Carr77
262 posts
|
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
Hittest a class?
Hello. I have a player.
This is the code in the frame :D
player.addEventListener(Event.ENTER_FRAME, hittheground);
function hittheground(event:Event):void{
if (player.hitTestObject(ground)) {
trace("BOM!")
} else {
player.y += 10
}
}
Well… that works great! The player hit the MC ground and evrything is perfect.
Well… but now I want many grounds and platforms… so I made a class called ground.
How do I make so the player hits the class “ground”?
I tried to change hitTestObject to hitTestClass but that did not work out lol x)
Please help :)
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
3D game making software
Use Blender to create all 3D stuff.
Then use Unity to like…. program all the 3D stuff you created :D
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
Basic AS3 preloader?
Hello.
I don’t want like… a newgrounds or kongregate preloader in my game/movie.
So I though, “I could make my own!”. I googled around and I saw that this was
much harder then I though…
So I am just wondering:
Is there some code that you can just paste in the first frame and then put a lil dynamic textbox in the game/movie and it is done?
I don’t want like… bars and all that complicated stuff…
So does a code like this exist?
That you SO MUCH for answering!
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
Unity to SWF?
Well, Im using Google Chrome and the games don’t crash here.
But the browser will crash if im opening 2-3 Unity games at once…
But if Im just opening one Unity game evrything works perfect :D
P.S. But srsly!
Guys! Try that danish/german war game on kongregate’s frontpage! Before Unity you couldn’t do that!… or… could you?
Is there another way to create games like that without Unity?
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
Many names in one "if"?
Hello!
How can i add many diffrent names in one if thing?
[pre]
ball.addEventListener(Event.ENTER_FRAME, enter_frame);
function enter_frame(event:Event):void{
if (player.hitTestObject(ground)) {
trace(“ BOM!”)
} else {
ball.y += 20
}
}
[/pre]
Well, I have many ground stuff. So how do I put like many diffrent stuff there?
Like I tried this:
if (player.hitTestObject(ground),(ground2)) {
And this:
if (player.hitTestObject(ground)||(ground2)) {
And many other diffrent things. No one worked.
Please help?
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
[solved] Unity and savegames
Well…
If you want to go the cheap way, you could give each level a secret password and then have a textbox thing in the menu.
That’s the easy way.
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
AS3 timer trouble!
Hello.
I have a trouble.
Let’s say I have 3 frames.
On the first one, my timer, and a button.
On the second one, the text “You lose!”.
On the third one, the text “You win!”.
Well.
The timer simply says something like “After 5 seconds, you’re transported to frame 2!”.
So, if you wait 5 seconds you lose.
BUT! If you press the button, you’ll go to frame 3… + the timer stops!
Because now, when I run this, and maybe let’s say I’ll press the button after 2 sec, then i am on the third frame in 3 sec and then I’ll go to the “Lose”-frame.
So… How do I create a timer that stops when I press a button + go to another frame?
I have tried much diffrent stuff. But it didnt work :(
I even tried to put the timers “removeEventListener” in the button actions.
So, how can I do this?
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
[as3] Send my childrens to the back ???
Hello!
I have an button and when you click that it will add a child :D
But the child is OVER all the other movieclips. I want it to make so its behind evrything.
In MCs you can just rightclick > arrange > send to back.
Buuuut because its a child i cant click on it because its not on tha stage… so…
What/how do i do to send it to the back?!
With codes?
Plz, help.
P.S. ACTIONSCRIPT 3 :DDDD
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
[AS3] How do i remove my child?!
I tried this:
parent.removeChild(this);
And the “real” MC is named Store and the child is named shop so it was like this
Store.removeChild(shop);
Didnt work…
What did i do wrong?
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
[AS3] How do i remove my child?!
I have this in the main timeline of an MC:
backbtn.addEventListener(MouseEvent.MOUSE_DOWN, clickely);
function clickely (e:MouseEvent): void{
removeChild(shop);
}
I wanna remove the shop child in the main timeline… D:
p.s. The MC that the code is in is the shop child. I simply want it to delete itself.
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
HitTest in actionscript 3?
Hello, im studying AS 3 and its really fun :)
But i have a problem. Good old HitTest doesnt work. How do i do something like hittest in As3?
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
Change the width and height on MCs with AS3 [AS3]
Hello.
Have an MC called wew.
If i put this in the frame it works:
wew.x=5;
wew.y=5;
but if i put this in the frame it soesnt work:
wew.w=5;
wew.h=5;
Why? Help plz!
|
|
|
Carr77
262 posts
|
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
[AS3] Use "if" on a variable?!
Helloooooo…
I got an variable: var lol:int=0;
then in a function i got this:
if (lol==5;){
trace(“lolz, ya made it :D”);
}
Dont work, watz tha problem? :O
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
[AS3] Remove a function thingy.
This is the whole code block:
function mooning(e:Event):void{
sikte.x=mouseX;
sikte.y=mouseY;
if (sikte.y > 260){
sikte.gotoAndPlay(2);
klicka = null;
} else {
sikte.gotoAndPlay(1);
}
}
As you see i tried klicka = null; but that didnt work.
I want klicka funktion to stop working if sikte.y goes over 260.
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
[AS3] Remove a function thingy.
I tried:
klicka:function=false;
and i tried:
klicka=false;
Nothin worked.
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
[AS3] Remove a function thingy.
Hello.
I have a fuction called klicka.
I wondered. How do i kill/pause this function?
Like if i have a button or something and click the function dies?
|
|
|
Carr77
262 posts
|
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
Create A Game For Kongregate?
Yeah, but for those that just started there developing adventure its easiest to start it with flash.
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
Whats wrong with this AS3 code?
Ok. Now the dynamics work. But when i press the MCs nothin happens? Why?
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
Whats wrong with this AS3 code?
Ok, i dunno why but that error didnt pop up now. Anyways, when i run evrything its no errors. But nothin happens when i click the MCs an i can see the variables.
(I have dynamics so i can see them).
Well i traced the variables and it has them.
But its somehow not linked to my dynamics.
My dynamics is just a bunch of dynamic text boxes with the same instance name as the variables. whats wrong?
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
Whats wrong with this AS3 code?
Yeah, i have 3 MCs with that instance names.
|
|
|
Carr77
262 posts
|
Topic: Game Programming /
Whats wrong with this AS3 code?
Oh, im sry, my internet lagged and now i posted 10000 times :(
|