Recent posts by Josh1billion on Kongregate

Subscribe to Recent posts by Josh1billion on Kongregate

Dec 1, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / [AS2] ignoring the IF statement

You have a semicolon at the end of your if statement. Remove the semicolon.

i.e…

if (score >= 500);

becomes..

if (score >= 500)

 
Nov 16, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate / does anyone have all the kongai cards

I now have all of ’em. Thanks Onimaru!

 
Nov 11, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / Loading + storing an external image as a MovieClip, then displaying it later

Is there then a way to copy data from the stored movieclip in my class into that new movieclip? Essentially using my class as a preloader.

 
Nov 11, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / Loading + storing an external image as a MovieClip, then displaying it later

Aaaaaaaanyone?

 
Nov 11, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / Anti-Cheat Protection (Sticky)

var foo = 1; // set foo to 1
if ( foo != 1 ) { cheatAlert(); } // in case someone cheats after I set foo!

lulz

Note to all: Take this entire thread with a grain of salt.

 
Nov 11, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / Loading + storing an external image as a MovieClip, then displaying it later

To load an image you would first use createEmptyMovieClip and then loadMovie the image into that MovieClip.

Alright.. but how would I display the movieclip on the screen/stage?

 
Nov 10, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / AS2 or AS3?

You shouldn’t be using tutorials to write your code for you anyway.

Since when was that the purpose of a tutorial..?

If after reading the tutorial you’re not capable of writing the same code by yourself without minimal reference to documentation or the language reference, then the tutorial was a waste of your time.

That’s debatable. It’s often a good idea to code with documentation open in the background (and this applies to any language or API).

If you have any OOP background, AS3 will be ridiculously easy.

This is also false^. ActionScript defies many game programming conventions, and you’ll have to find ways to hack in solutions for problems. For example, compare scrolling (in a 2D platformer or otherwise) in ActionScript to the same thing in C++ [with a common API like DirectDraw, Windows GDI, or Allegro].

In regards to the original question:

In my experience, I originally decided to go with ActionScript 3.0, with the main reason being “it’s newer.” But, as you’ll soon find out, there is a relative lack of resources available online compared to AS 2.0. Even being a very experienced C++ and PHP programmer, AS 3.0 was more challenging to learn mostly because of the lack of online resources. If you have a physical copy of an AS 3.0 book and are willing to put your trust in it (that it will cover every single question you may have) and are dedicated enough to plow through the entire thing, maybe that’s a better choice. But personally, I’ve decided to dabble a bit in AS 2.0 before continuing into 3.0.

 
Nov 10, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / Loading + storing an external image as a MovieClip, then displaying it later

(using ActionScript 2.0)

I have a class:

class Component
{
	var image_mc:MovieClip; // the image data itself
	var image_filename; // filename of the image
	
	function Component(filename)
	{
		image_filename = filename;
		image_mc = new MovieClip();
		loadMovie("http://localhost/" + image_filename, image_mc);
	}
}

Then in some other code, of course, the object is created:

var _root.foo:Component = new Component("helloworld.jpg");

How can I display root.foo’s image (imagemc) on the stage at some point down the road? I have tried something similar to root.add(root.foo.image_mc); and that didn’t work (not even if I set the x, _y, and _visible variables of the imagemc member).

 
Nov 6, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate / Remnants of Skystone Alpha Testers Wanted

Signing up, sounds awesome.

 
Nov 6, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate / kicked off=(

That is odd. I dont know anyone strong enough to kick a person off of a computer.

lulz

 
Nov 6, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate / No ad revenue given yesterday?

Okay, thanks. The info is showing up now.

 
Nov 6, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate / No ad revenue given yesterday?

My three Kongre-games yesterday received 543 plays @ 486 ad impressions, but the gross earnings and net earnings are both at $0.00 for yesterday. Is this even possible?

Note that everything was fine the day before, with several dollars being generated, with a similar number of plays.

 
Nov 4, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate / Why DON'T you want to become a mod?

This reminds me of my old thread..
http://www.kongregate.com/forums/1/topics/17837

 
Nov 2, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate / Deleting highscores is here!

Can someone clear two high scores (and statistics) from my game ? I had a bug in there where the player would automatically get a perfect score of 100 no matter what.. quite a bug! Anyway, it is fixed now, but the scores remain there. Snicker80 and I have the two scores of 100.

Note that a score of 100 is virtually impossible to achieve (with the bug gone).

 
Nov 2, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / Low FPS

You should set the game fps a bit higher than the fps that it should be because web browsers slow it down a bit.

I don’t know if I really agree with that.

 
Nov 1, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / Using loadMovie() to load an external image from web causes onEnterFrame() to be replaced - how do you avoid this?

Seems like it’d be easier to create another movie clip within your game object, and load it into that instead.

That’s probably the best solution.

But nevermind now, I decided to use a different solution, albeit it may not be the best solution possible but it was certainly easy: I created two movieclips— one for the avatar/image, and the other for the game object itself which controls that avatar/image by modifying the _x and _y etc. of the other one.

 
Nov 1, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / Using loadMovie() to load an external image from web causes onEnterFrame() to be replaced - how do you avoid this?

I have an object in my game whose sprite (a single frame image) is loaded from the web through the loadMovie() function.

However, as you may know, using loadMovie() replaces the onEnterFrame() function, meaning my game object can’t really do anything after its image has been loaded.

How do I avoid this problem? I saw a tutorial on this topic half an hour ago, but despite constant googling, I cannot find it back.

 
Oct 29, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate Labs / How to submit an non-published Game?

You have ad revenue on an unpublished game?

 
Oct 29, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate Labs / How to submit an non-published Game?

Can you delete the unpublished game and then re-upload it as a new game?

 
Oct 28, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / Programing tower defence games

If you have past experience in game programming in general, you should be able to write a TD game without too much hassle.

(I did.)

 
Oct 25, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate Labs / How many competitors are there?

I’m entering. :)

This will be my second ActionScript project, with my first being only a small memory (matching) game.

I’ll enter, but I don’t really want to put my non-existent credit card information etc

You don’t need a credit card to upload a game nor to enter the contest. I’m 99% sure all you need is a name and address (unless your earnings exceed $600 in a year, in which case you’ll need to submit tax information, according to one of the Kongregate FAQ’s).

 
Oct 23, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate / Vectorious Alpha Testers Wanted

Signing up.

 
Oct 23, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Kongregate / Kongregates Social Aspect

?

Seems a reply has been deleted. A good social system upgrade would be to remove the possibility to delete posts after someone else has replied. As is, it causes a lot of confusion.

 
Oct 23, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / Help - class can't access another class (extending MovieClip)'s variables except for the MovieClip variables [solved]

Ahhh..

My mistake was this – instead of having a constructor ( Missile() ), as I had in my example above (I was paraphrasing rather than pasting, so I typed it wrong), I was using the onLoad() function. So, essentially, I had this:…

class Missile extends MovieClip
{
  var damage;
  function onLoad()
  {
    damage = 10;
  }
}

…when I needed to have this:

class Missile extends MovieClip
{
  var damage;
  function Missile()
  {
    damage = 10;
  }
  function onLoad()
  {
    // this function must exist, even if it's empty, otherwise it oddly doesn't work
  }
}

Thanks for your help, everyone. The mention of the word “constructor”, in particular, set me off in the right direction here. :P

 
Oct 23, 2008
avatar for Josh1billion Josh1billion 516 posts

Topic: Programming / Help - class can't access another class (extending MovieClip)'s variables except for the MovieClip variables [solved]

I tried specifically expressing that damage a public variable, and that didn’t work.