DougWiiBoy
81 posts
|
Topic: Game Programming /
Change Component Parameters at Runtime
Originally posted by jonathanasdf:
I thought treating the parameter as a property worked. Does it not?
eg. component.param = xxx
Wow… That was simple, thanks!
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Change Component Parameters at Runtime
Does anyone know of a way to change a component’s parameters at runtime, say in actionscript (3.0)? As always, any help is appreciated.
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Simple Easy Physics AS3
Oh, here we go. Double post (sorry) but I thought this might be quite beneficial to others as well, its exactly what i was looking for.
http://www.sideroller.com/wck/
http://gotoandlearn.com/play.php?id=135
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Simple Easy Physics AS3
Alright, thanks for the help. I have managed to find a few useful links from him.
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Simple Easy Physics AS3
Yeah, I have seen his work before, but it is very little apart from a big block of code and a few lines telling what it does. I still would have no idea how to make my blocks look something apart from transparent blocks.
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Obstacles
Originally posted by Iggly:
wow do u always spell everything right? just coz i write u instead of you. sheesh
no ≠ know
[:
|
|
|
DougWiiBoy
81 posts
|
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Simple Easy Physics AS3
I know this has been asked before, but I am having major difficulties. I am looking to create a game with simple physics (mostly just rectangles) and have run into major issues in this area before. I know all of the physics engines (Box2d, Ape, FOAM, Fisix) exist, but they all are overly difficult to set up for such a simple task as rectangles, and have very few tutorials. I am lost here and would like some help if possible from the wonderful folks at Kongregate with this.
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Save Movieclip to Sharedobject?
Originally posted by Solanix:
Originally posted by DPbrad:
Im thinking you could maybe do something with a bitmap object with getPixels(), but this would require server-side scripts to save the data to your hard-drive.
getPixels() is AS3 only, the best you could do is build an array or string using getPixel() pixel by pixel, store it in a shared object along with the height/width, then use setPixel() when you want to rebuild the image.
Originally posted by DougWiiBoy:
Originally posted by Draco18s:
Red5 is pretty much install-n-go. I had some issues getting it to run, but it was just an issue of environment variables on Windows.
Once I had Red5 0.7 (not 0.9) the Flash demo I had found worked perfectly.
Edit:
How to save images with Flash.
Shoot i suppose i have to learn all of this again in as3 to save. Oh well i will give Red5 a try. Thanks guys!
Is this meant to be an online app or can it be local? Because if it is local and you’re planning on switching to AS3, then you could use AIR instead and get full access to the hard drive directly.
Local app. Thats a nice tip though. Thanks!
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Save Movieclip to Sharedobject?
Originally posted by Draco18s:
Red5 is pretty much install-n-go. I had some issues getting it to run, but it was just an issue of environment variables on Windows.
Once I had Red5 0.7 (not 0.9) the Flash demo I had found worked perfectly.
Edit:
How to save images with Flash.
Shoot i suppose i have to learn all of this again in as3 to save. Oh well i will give Red5 a try. Thanks guys!
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Save Movieclip to Sharedobject?
Originally posted by DPbrad:
Im thinking you could maybe do something with a bitmap object with getPixels(), but this would require server-side scripts to save the data to your hard-drive.
Really it doesnt matter where it is stored as long as the user can access it later.
Originally posted by Draco18s:
Originally posted by DougWiiBoy:so when u navigate away from the frame the image is effectively lost. Is this impossible to save or am i overlooking something? from what i have read saving to hard drive is not the way to go since this is a surveillance camera and should not require much, if any, user interaction once it it set to start taking screenshots.
Are you you trying to save VIDEO? If so, you need a Media Server, I suggest Red5.
Red5 looks cool but it may just be a bit much. I dont know java anyways…
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Save Movieclip to Sharedobject?
Originally posted by Draco18s:
Originally posted by DougWiiBoy:so when u navigate away from the frame the image is effectively lost. Is this impossible to save or am i overlooking something? from what i have read saving to hard drive is not the way to go since this is a surveillance camera and should not require much, if any, user interaction once it it set to start taking screenshots.
Are you you trying to save VIDEO? If so, you need a Media Server, I suggest Red5.
nope, screenshots but i am thinking this might be impossible
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Save Movieclip to Sharedobject?
Ok well i am sure i am missing something, not meaning to be a pain but i think this would be a helpful thread if an answer was found. Any other ways out there to save it?
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Save Movieclip to Sharedobject?
Originally posted by Draco18s:
Originally posted by DougWiiBoy:
well… can u store movieclips? or save to hard drive? any as2 masters out there?
No. You can’t. You need to individually save each variable the MC has (x and y position, etc) so you load them back in.
As for saving “anything” to your hard drive, I don’t know about in AS2, but I did run into (at one point) examples of how to save webcam still images to your computer, nothing else.
my script to add the image to a movieclip:
this.onEnterFrame = function() {
var actLevel:Number = cam.activityLevel;
root.act_txt.text = "Activity Level = "+actLevel;
if (actLevel>_global.neededAct) {
screenS.draw(video_vobj);
screenSDisplay_mc.attachBitmap(screenS,1);
}
frameCounter++;
};
so when u navigate away from the frame the image is effectively lost. Is this impossible to save or am i overlooking something? from what i have read saving to hard drive is not the way to go since this is a surveillance camera and should not require much, if any, user interaction once it it set to start taking screenshots.
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Save Movieclip to Sharedobject?
Originally posted by Draco18s:
Originally posted by HotAirRaccoon:
Shared objects are quite annoying. I’m not sure about this, but I did learn the hard way that you cannot save arrays to them
Yes you can. o.O
I’ve got a project I’m working on right now that uses arrays inside Shared Objects. And yes, in AS2.
well… can u store movieclips? or save to hard drive? any as2 masters out there?
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Save Movieclip to Sharedobject?
Originally posted by HotAirRaccoon:
Shared objects are quite annoying. I’m not sure about this, but I did learn the hard way that you cannot save arrays to them, so my instinct is to doubt you can save anything beyond the very simple data types, like strings, numbers, booleans, etc…
hmmmm… If so, i think i am going to have to find a workaround…. I still need to permanently store the images. Any ideas? This is my first time dealing with stuff like this 0.o
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Save Movieclip to Sharedobject?
Oh whoops sorry i forgot to say its as2 :P i was in a hurry sorry :)
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Save Movieclip to Sharedobject?
Does anyone know if it is possible to save a movieclip or image file to a shared object? I am making a surveillance camera that takes a screenshot from a webcam when there is activity. If not is there any way to save images to a folder on the user’s hard drive? I need to be able to store and re-open the images multiple times.
Thanks!
|
|
|
DougWiiBoy
81 posts
|
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Hit test for whole side of object?
here is most of the code so far (the important part)
onClipEvent (enterFrame) {
if (Key.isDown(16)) {//run checker
run = true;
} else {
run = false;
}
//move codes--
if (gamePaused == false) {//check if game is paused
if (Key.isDown(Key.UP)) {//key up code
if (CollisionDetection.checkForCollision(this.topBar, _root.ground.noWalk, 255)) {
} else {
if (run == false) {
this._y -= 2;
} else {
this._y -= 3;
}
}
}
if (Key.isDown(Key.DOWN)) {//key down code
if (CollisionDetection.checkForCollision(this.lowerBar, _root.ground.noWalk, 255)) {
} else {
if (run == false) {
this._y += 2;
} else {
this._y += 3;
}
}
}
if (Key.isDown(Key.LEFT)) {//key left code
if (CollisionDetection.checkForCollision(this.leftBar, _root.ground.noWalk, 255)) {
} else {
if (run == false) {
this._x -= 2;
} else {
this._x -= 3;
}
}
}
if (Key.isDown(Key.RIGHT)) {//key right code
if (CollisionDetection.checkForCollision(this.rightBar, _root.ground.noWalk, 255)) {
} else {
if (run == false) {
this._x += 2;
} else {
this._x += 3;
}
}
}
}
//pause codes--
if (Key.isDown(80)) {
if (delay == 0) {
if (gamePaused == false) {
gamePaused = true;
delay = 24;
} else {
gamePaused = false;
delay = 24;
}
}
}
if (gamePaused == true) {
_root.inventory._visible = true;
} else {
_root.inventory._visible = false;
}
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Hit test for whole side of object?
Originally posted by Feltope:
Check that out ;-)
http://www.gskinner.com/blog/archives/2005/08/flash_8_shape_b.html
when all is said and done, it accomplished the same thing as a normal hit test except more buggy. There is still the same original leaking problem with the movieclip the character can slip through at the parts that weren’t hit tested. :( :( :(
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
MC vs Sprites
If you are referring to graphics, they do have multiple frames but no instance names or coding :)
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Hit test for whole side of object?
Looking at that there seems to be an easier way… I just used a few lines and hit tested those to the no walk zone. Unfortunately, the no walk zone is shaped in an odd way so if you want to walk into the curve it doesn’t let you because that is part of the movieclip.
Example ( | and _ are walls)
_______
| xxxxx |
| can’t
| walk
| here
my hit test code: (for top)
_root.ground.noWalk.hitTest(this.topBar)
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Hit test for whole side of object?
Originally posted by Draco18s:
You want to hittest against 3 points (of 8):
Your 8 points are:
Upper left corner, middle of top side, upper right corner, middle left side, Middle right side, lower left corner, middle of bottom side, lower right corner.
The three you actually need to check are the three that are in the direction of travel, so if the player is traveling to the right, you hit test the center right, upper right, and lower right.
Hmmm… that would have worked but since some of the walls are thin, the character can slip through at the parts that weren’t hit tested… any other suggestions?
|
|
|
DougWiiBoy
81 posts
|
Topic: Game Programming /
Hit test for whole side of object?
Ugh still not working… I still need to be able to hit test a whole side not just a point… any help would be appreciated :)
|