News:

Welcome to the new Sinister Design forums!

Main Menu

Ask the developer a question!

Started by CraigStern, February 07, 2010, 11:01:17 AM

Previous topic - Next topic

CraigStern

Oh, I don't want to spoil it. ;)

Quote from: Guye on May 12, 2010, 09:47:28 PMOn a less serious (but coincidentally related) note, I don't suppose you would mind giving out any disturbingly vague details or enticingly cryptic clues about the trial scene you recently mentioned being in the game.

For the right price, sir, I will have any legal expertise you want!

Guye

I'm flattered by your speedy denouncement of the moral implications of defending an obviously guilty murderer, when in light of a speedy paycheck. Unfortunately my funds may not be quite enough to buy your services at the moment. I may or may not have lost a vast amount of money gambling in Reno. This also may or may not have something to due with the aforementioned murder.

Quote from: CraigStern on May 12, 2010, 09:55:39 PM
Oh, I don't want to spoil it. ;)

Such a tease.

algebra15

sorry to interrupt, but if one wants an onEnterFrame behavior on all the instances of one object, how would one phrase the onEnterFrame? More specifically, WHATGOESHERE.onEnterFrame. I tried to use the name of the library item, ("platform") but it only worked on instances named "platform."


P.S. as another question, how do you change the game so people can't just right-click the game and step forward or backward?
This is Gambit. The cards are about to explode. Goodbye!

CraigStern

You have to give every movieclip a unique instance name regardless. So whatever code you're using to generate the movieclip instances, simply include an onEnterFrame function. For example (using AS2):

newInstanceNumber = 0;

function generateInstance () {

newInstanceNumber++;
var newInstanceDepth:Number = 50 + newInstanceNumber;
var newInstanceName:String = "movieClipName" + newInstanceNumber;

var newInstance:MovieClip = attachMovie("movieClipName" , newInstanceName , newInstanceDepth);

newInstance.onEnterFrame = function () {
//here goes whatever you want each movieclip to do on every frame
}

}

//this should run generateInstance 20 times, thus creating movieClipName1 through movieClipName20
for (i = 1; i < 21; i++) {
generateInstance();
}


Quote from: algebra15 on May 14, 2010, 08:48:45 PMP.S. as another question, how do you change the game so people can't just right-click the game and step forward or backward?

I believe you'd want something like this, provided you're working in AS2 or lower:

var myMenu:ContextMenu = new ContextMenu();
myMenu.hideBuiltInItems();
_root.menu = myMenu;


AS3 works pretty much the same way.

I hope that helps!

Duskling

With all due respect, Creator, you don't participate in the games very much, why? ???

CraigStern

The forum games, you mean? Well, it's mostly because I try to spend my free time working on TSoG, answering questions, and marketing the game. I only have so many hours in a day, you know. ;)

Right now, for instance, I'm working out some bugs I caught when I was playtesting earlier today. Every moment I spend thinking of clever ways to corrupt a wish is a moment I'm not spending making TSoG better.

Duskling

Fair enough, but don't you have some magic free hour when you are too tired to work on TSoG, but not so to as to participate in a forum game?

CraigStern

Occasionally--but that's what my girlfriend is for! :D

Duskling


Zhampir

Wow, Duskling, aren't we getting personal?
It's his PCG (Personal Computerized Girlfriend)!^^
How many hours (on average) per day/week/weekend/etc do you spend on TSoG?

algebra15

Before this conversation gets too far astray (and it may have already), thanks a million.
This is Gambit. The cards are about to explode. Goodbye!

CraigStern

No problem. :)

Quote from: Zhampir on May 15, 2010, 01:32:00 AMHow many hours (on average) per day/week/weekend/etc do you spend on TSoG?

Honestly? I'm not sure. I typically work on TSoG for a couple of hours before I leave for work. I oftentimes write dialog or think up ideas while I'm riding the train to or from work. Then I usually spend between one hour and six hours working on it after I get home, depending on the circumstances.

Xemadus Echina

you ride a train to work? a real train  or a subway? or a trolly?

is KZ ever gonna come back?

will the telepath testing crew ever have a real home? (not just the thread i started it in)
im writing a book!
http://sinisterdesign.net/forum/index.php?topic=236.0;topicseen
heres a free verse poem I wrote for school
You never know
Just what you will find after you
Lost your favorite thing. But
The important thing is that the
Game you play will help you to get by.

algebra15

I was making some code for the game I asked you about before, and I opted to make it a bit differently. The code makes 5 platforms once. Problem is, "thyPlatform"'s properties and methods seem to go away when the variable is assigned to a different platform; this means only one works, and causes the jumper to bounce. I also have some code for the class "Platform", but the hitTest seems not to work as simply as it does in the frame code.
_root.makePlatform = function(){
if (_root.make != true){
for (x = 0; x < 5; x += 1){
newPlatformNumber += 1;
_root.attachMovie("platform", "platform" + newPlatformNumber, 50+newPlatformNumber);
thyPlatform = eval("platform" + newPlatformNumber);
thyPlatform.onEnterFrame = function(){
thyPlatform.checkJumper();
}

thyPlatform.checkJumper = function(){
if (thyPlatform.hitTest(jumper._x, jumper._y, true) && (jumper.dy > 0)){
_root.boing = true;
trace(_root.boing);
}
}
_root.make = true;
}
}
}

Class:
class Platform extends MovieClip {
function Platform(){
_x = Math.random()*Stage.width;
_y = 400;
}
function checkJumper(){
if (
}
}
This is Gambit. The cards are about to explode. Goodbye!

algebra15

sorry for double post, but I forgot to add the question. Is there a better way to do this with the structure I've got, or to I have to rip it out and start again with coding for the class?
This is Gambit. The cards are about to explode. Goodbye!