Kits/packages for advent-type games?

APDamien

  • Posts: 8
I'm starting to create an adventure-type game.  Not "action-adventure", just adventure.  A visual, point-and-click version of games like Colossal Cave Adventure
http://en.wikipedia.org/wiki/Colossal_Cave_Adventure
or Zork
http://en.wikipedia.org/wiki/Zork

The game will consist of a bunch of scenes, each of which will display a background image.  There may also be items that can be picked up (by clicking on them) and optional actions (displayed as text).  There will also be arrows, which lead to other scenes (adjacent rooms, in adventure-speak).

So, for the most part all I need is:

1. Display fixed text
2. Things that would be called " buttons" in Flash: click on them and a little piece of AS gets run.  Some of those will be other characters, some objects that you can add to your inventory, some the arrows to move from room to room.
3. Display images imported from an external source (jpegs, etc.)
4. Eventually I hope to replace the fixed images with animations, either poser animations or shape tweens between end-states (e.g., person sitting in a chair, standing up, right-foot forward -> left-foot forward (to make a figure walk).

But if I can just do 1,2, and 3 I'll be happy.

Are there any packages or "kits" for building a game of this sort?

APDamien

  • Posts: 8
I should add that so far I haven't even figured out how to put fixed text (e.g., the initial disclaimer) on the screen.  Am I going to have to write actionscript for every text message I want to display?

almyki

  • Posts: 156
Try Drawing > Drawing > Basic to find the 'draw text [text]' block,  Check out this block document for more info on that =3 .  I hope that's what you needed.

As for 'button' like things... I'm not sure 100% if this is what you mean, but wouldn't you just be able to use an 'if <mouse was clicked on [Actor]>' block for that ^^; ?

As for displaying exported images, I'm also unsure what you mean?  You can import an image to use for an Actor through the Appearance tab of the Actor, as well as animation strips.  You can import tilesets, background images, etc. too from your computer.  You can also download these things from Forge.  SW allows JPEGs, GIFs, and PNGs.  Do you mean something different from this? 

I'm sorry if I misunderstood any of your questions, I hope any of this helps out.

<3 ali
dA |

Skills:  Drawn art, writing/story concepts, drawn backgrounds.
Preferred Games:  Visual Novels, RPGs, Simulations, Sandboxes, Dress-Ups
Current Projects:  Pokepet Eevee!

APDamien

  • Posts: 8
Okay, I guess the answer is that I need to write ActionScript for each chunk of text, and for each button.

A couple more questions:

1. How do I set the font that will be used (typeface, size, color, bold/italic/normal)

2. Are "X" and "Y" measured in pixels or tiles? If the latter, can I use fractional values?  Can I set a "tilesize" of 1 so I can place things to the pixel?

Alexin

  • *
  • Posts: 3132
1. Fonts are top-level resources, available in the Game Center. To use them in a behavior, create an attribute of the type Font. There's always a default font for cases where none is specified.

2. Coordinates are specified in pixels. You can use any number, the closest integer is used when the actual drawing operation occurs.
"Find the fun"
alexin@stencyl.com

APDamien

  • Posts: 8
I have created fonts in my game for the text I want to draw.  How do I specify which one to use?

Graphics.defaultFont = new Font(???) ?

What about making the text items clickable?  Do I need to wrap them in an invisible rectangle or something?  I would also like them to react to hover events -- onMouseOver/onMouseOff, in Javascript terms.

I'm beginning to think I should just write the whole thing in HTML and Javascript, which I understand.  Maybe StencylWorks isn't a good match for what I want to do.  Or maybe the API documentation just needs to be enhanced with examples.

See the Java documentation for what I mean.  One example:
http://download.oracle.com/javase/6/docs/api/java/awt/font/TextLayout.html



Alexin

  • *
  • Posts: 3132
Graphics.setFont(aFontAttribute:Font);

To make the text clickable, you essentially need to calculate its bounding box. It's easier to wrap it in a rectangle and use it.

The API reference needs to be more substantial, yes. AS3 docs usually have inline examples.
"Find the fun"
alexin@stencyl.com

APDamien

  • Posts: 8
Graphics.setFont(aFontAttribute:Font);

To make the text clickable, you essentially need to calculate its bounding box. It's easier to wrap it in a rectangle and use it.

The API reference needs to be more substantial, yes. AS3 docs usually have inline examples.

Okay, I see how to set the font.  Could you provide an example of how to put the rectangle around it?  Let's say "DISCLAIMER" in 36 px #FF0000 (red) Helvetica (or sans-serif), with a clickable rectangle around it.  Paint it anywhere you like on the scene.

Oh, and while I'm at it, what is the "w" argument to drawString?

Alexin

  • *
  • Posts: 3132
Download the Demo kit to see how you use Flash TextField, among other things.

The "w" is short for width. h = height
"Find the fun"
alexin@stencyl.com