GormenGhast
164 posts
|
Topic: Game Programming /
HTML5 vs Flash
Any medium where you’re forced to expose your source code will never flourish in indie game development. The best you could hope for is server communication to at least conceal a bit of the game engine. I’d say that the most important bit of tech at the moment is Unity, particularly as it can now publish to flash 11 – some seriously impressive game efforts have been submitted to the current competition to show how versatile the platform is. WebGL and HTML5 will be used for web development, immersive ‘webscapes’ and stuff like that. They can facilitate game development, but it’s not their chief purpose.
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
[AS2] Preloader and Virtual Cam Questions
on(rollOver)
{
this.gotoAndStop(2)
}
on(rollOut)
{
this.gotoAndStop(1)
}
on(press)
{
if(this._currentframe==2)
{
_root.gotoAndStop("Game");
}
}
Just quickly did this… if you have a button that will appear when your loader reaches 100, then placing this script inside the instance’s actions will make it go to any frame named Game on click. I’m assuming here that you’ve got a 2 frame movieclip for the button (NOT a button class, but most definitely a movieclip, with one frame for unpressed graphic and one frame for the pressed graphic). Alternatively you can replace the Game frame with the root timeline frame number.
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
[AS2] Removing Movieclip Problem
If a movieclip is added dynamically and is not given a set depth, it will not be removed when that function is called. What would be super useful is if you could post the exact script you’ve used to attach the movieclip.
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
[AS2] Preloader and Virtual Cam Questions
1. Within your 100 frame loading movieclip just place your “play” button on frame 100, and give it a function where it will root.gotoAndStop(“whatever you’ve called your main game frame”) Alternatively, you can make a movieclip which will only display on 100% load completion (using if (loading !=done){_alpha=0;}else{alpha=100}) or something along those lines.
2. Virtual cams depend pretty heavily on how you’re creating your level. A pretty resilient solution, though, is to centre the map on a virtual point which follows your main character by easing. For easing tutorials, try emanuele feronato’s blog.
If you want any actual code, you’re going to probably have to post a snippet of what you have at the moment :)
EDIT: Underscores not behaving!
|
|
|
GormenGhast
164 posts
|
Topic: Kongregate /
Whoa! Achievement Unlocked 2 is the top rated game!
I’m with the frogman on this one. Crappy movement, rubbish graphics, poorly executed and crazily annoying music. It’s a poor game that’s a thinly veiled (actually, not veiled at all) cash in on the original game, which was in itself a bit of a joke, poking fun at metagaming. It seems they have fallen victim to the same mediocrity that they were originally mocking.
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
Preloader problem - Please help!
I've been having a fairly large amount of trouble with my preloader for some time now.
I have set my classes and other resources (pngs, wavs, mp3s) to export on frame 2. In frame one is my preloader.
I get a blank screen for ages, and then my preloader appears fully loaded.
I generated a report, and this is what it said:
Frame # Frame Bytes Total Bytes Scene
------- ----------- ----------- ----------------
1 2372976 2372976 Scene 1
2 175955 2548931 (AS 2.0 Classes Export Frame)
Somebody help! I want it to go straight to the preloader, not wait until it's loaded and then fire it up. At the moment the 2.3Mb of 2.5Mb is being loaded in frame 1 before the preloader.
Help!
|
|
|
GormenGhast
164 posts
|
Topic: Kongregate /
Ultimate Kongregate Photo Topic
With a few slight modifications, I think you could have yourself a hoverboard.
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
Sound Problem (AS2)
I have a problem with sound looping. The following code doesn’t work:
class BGS extends MovieClip
{
var BGM;
function onLoad()
{
BGM=new Sound(this);
BGM.attachSound("TitleLoopSeg1");
BGM.setVolume(50);
BGM.onSoundComplete = playnext;
BGM.start();
}
function playnext()
{
BGM.attachSound("TitleLoopSeg2");
BGM.setVolume(50);
BGM.onSoundComplete = playnext;
BGM.start();
}
}
but when I substitute the contents of the ‘playnext’ function with a trace command it works. Why is that? Any ideas or help? Mars bar rewards, I promise.
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
Some (supposedly) quick questions
I’d just like to say that this:
for (var i = 0; i < myArray.length; i++)
{
if (myArray[i]._x == undefined)
{
myArray.splice[i,1];
}
}
is absolutely brilliant. Really great stuff – thank you truefire.
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
Credit "Magnet" Bug [AS3]
Let me show you what I used, might be of help. This is within the collectible item:
var dx:Number = WhateverthecoinisZoomingtowards._x - _x;
var dy:Number = WhateverthecoinisZoomingtowards._y - _y;
if(((Math.abs(dx)<magnetreach)&&(Math.abs(dy)<magnetreach))||magnetised==true)
{
_x += (WhateverthecoinisZoomingtowards._x-_x)/speed;
_y += (WhateverthecoinisZoomingtowards._y-_y)/speed;
magnetised=true;
if((Math.abs(dx)<ReallyCloseLike5Pixels)&&(Math.abs(dy)<ReallyCloseLike5Pixels))
{
if(this.hitTest(WhateverthecoinisZoomingtowards))
{
//do things like add score and make the coin disappear
}
}
}
This also has the hittest within the proximity function, so you don’t waste processing power hittesting whilst your collectible isn’t close enough to your collector.
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
ColorMatrixFailter! [AS2] Yeah I did a pun on Filter. So what?
Oh Moonkey!
You came and you gave without taking.
And I need you today
Oh Moonkey.
Edit: And also thanks, it works beautifully now :)
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
ColorMatrixFailter! [AS2] Yeah I did a pun on Filter. So what?
Hi everyone,
I’m trying at the moment to make a shootemup, and when I hit the enemies with my bullets I want them to flash white. I’ve managed to make it happen, but then about 10 shots in… KABAM! The white flashing stops working. Here’s the code I’m using for the white flashes:
//hit test versus bullets
for(var i in _root.Masterinst.Bulletbox)
{
if(this.hitTest( _root.Masterinst.Bulletbox[i] ) )
{
this.energy-=_root.Masterinst.Bulletpower;
_root.Masterinst.Bulletbox[i].removeMovieClip();
if(whcount<=1)
{
whcount+=10;
}
}
if(whcount>1)
{
whcount--;
}
White = [whcount,0,0,0,0, /* Red */
0,whcount,0,0,0, /* Green */
0,0,whcount,0,0, /* Blue */
0,0,0,1,0 ]; /* Alpha Transparency */
colorMatrix = new ColorMatrixFilter(White);
this.filters = [colorMatrix];
}
Where Bulletbox is where I’m storing my bullets (unsurprisingly) and that colormatrixfilter is for my ship’s panicky white flash. I want it to start working and stay working… any ideas?
Thanks
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
AS2 Sound management
In the main frame? Thanks for the help, by the way :D
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
AS2 Sound management
Hi. I’m trying to write a class that will deal with my sound loops at different points of my game.
In this example I’m trying to make a sound play, and then on completion launch into a different sound. Needless to say it doesn’t work, and here I am!
class TitleLoop extends MovieClip
{
var played=false;
var bgSound;
function onEnterFrame()
{
if(played==false)
{
bgSound = new Sound(this);
bgSound.attachSound("TitleLoopSeg1.mp3");
bgSound.start(0, 1);
played=true;
}
bgSound.onSoundComplete = function()
{
trace("pop")
bgSound.attachSound("TitleLoopSeg1.mp3");
bgSound.start(0, 1);
}
}
}
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
Save files problem, Array to sharedObject [AS2]
Firstly, if you clicked this to help me based on the title alone you are both awesome and a masochist.
function Save()
{
countarray[0]=lootcount;
countarray[1]=chaintot;
trace(countarray)
saveslot01.data.countarray = countarray;
}
lootcount and chaintot are both numeric variables. The trace of the array and of the sharedobject data (saveslot01) both come up as ‘undefined,undefined’ after the save function is run. Both variables are set at 5.
Help! Oh, please.
|
|
|
GormenGhast
164 posts
|
Topic: Kongregate /
Puzzled over VVVVVV Demo hate
I honestly think that it’s getting to the point where something on this should be included in the upload guidelines. It seems that all of this could be avoided if the developers call their full games something different from the demo – for example putting ‘world’ after the game name.
It boils down to people being indignant that someone is leading them down a path (supposedly unknowingly) where they’re going to eventually have to pay a toll to continue. Which, as has been said about a bajillion times, is pretty much how everything else on the internet works.
The history of flash games has followed the same path as every invention ever: good idea → popular concept → professional concept → higher quality, higher price. The flash games that are free aren’t disappearing and never will, so if you don’t like the idea of paid content then 1) pull yourself together a little bit and 2) steer clear of discussions like these. The feeling of entitlement that a worryingly large amount of you seem to have is never going to tally with the opinion of full time flash developers.
|
|
|
GormenGhast
164 posts
|
Topic: Kongregate /
animations on kongregate
Pow! Right in the kisser.
|
|
|
GormenGhast
164 posts
|
Topic: Kongregate /
Locked Content
So, Jes. You play a game without any mention at all of extra content. You thoroughly enjoy it and complete it. You rate it a 4/5.
SHOCK HORROR
The game says upon finishing that an extended version for people who really want to play on is on their website. Nothing has changed at all about the game you just rated 4/5. You then rate it 1/5?
I find it pretty hard to believe you’re calling people out on being irrational and not having any carefully structured answers when yours are a bit iffy at best. You seem to dismiss the fact that people who make games want to make money, but you do so without thinking at all what the implications of that are. Maybe you should have a little think about what’s going on here before you put the middle finger up to developers in future!
EDIT: Can’t believe I got trolled so hard.
|
|
|
GormenGhast
164 posts
|
Topic: Kongregate /
Still no use for Kongregate Points?
I think that the easiest way to stop questions like this once and for all would be to put the letters ‘exp.’ in front of points. Hey presto, people understand they’re just for levelling!
|
|
|
GormenGhast
164 posts
|
Topic: Kongregate /
WE NEED A SPAGNOSTIC CHAT ROOM!
Hmm. Hilarious as ever, but could I direct you here kind sir?
|
|
|
GormenGhast
164 posts
|
Topic: Kongregate /
Write Here If You Acquired All The Badges
I have all the badges. Providing you don’t count the badges I don’t have.
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
AS2 Button triggered by enter, not clicking
Hmm… thanks for the replies, guys. Got me thinking, and I ended up using a multi-frame movieclip instead of a button. Much better, as it can use all the commands a button can and more – makes me wonder what the point of a button is at all?
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
AS2 Button triggered by enter, not clicking
Ok. Still not working. the problem seems to be far more deep seated than I thought, though…
class Awardsbut extends Button
{
function onEnterFrame()
{
trace("button present!")
}
}
this comes up with no trace, and the button is most certainly present. Help! Oh, and thanks Draco18s!
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
AS2 Button triggered by enter, not clicking
Hi. I’ve never really used buttons before today, as movieclips kept me completely satisfied in every way. Times change however, and now I need to be able to use buttons.
How can I make it so that once certain criteria are met I can make a button be clicked/pushed?
if(Key.isDown(Key.ENTER)&&_root.TriggerCriteriaMet==true)
{
this.onRelease()
}
I’m putting the code in the button’s class script. Obviously the script above doesn’t work, but perhaps someone could help me out? Thanks in advance, world!
|
|
|
GormenGhast
164 posts
|
Topic: Game Programming /
Help Controling Animation with Actionscript.
Right… firstly you don’t really need two different frames with your character facing different directions. This is where you use the xscale function, which can flip your character round.
if(Key.isDown(Key.RIGHT)||Key.isDown(Key.LEFT))
{
this.gotoAndPlay(1);
}else{
this.gotoAndStop(1);
}
if(Key.isDown(Key.LEFT))
{
_xscale=-100;
}else if(Key.isDown(Key.RIGHT)){
_xscale=100;
}
This is from the top of my head and untested, but you get the idea.
EDIT: I didn’t put the movement variables in there, just the frame manipulation.
|