Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - tristonhopkins

Pages: 1
So a long while back I made a little map generation demo, which you can see here.

Just the other day I opened it up again and I'm trying to add a second method of map generation using cellular automata.  That's not where I'm running into trouble, though..

Here's the new and very broken build.

I can't for the life of me seem to figure out why my code is misbehaving so much.  For one, the map is supposed to be filled, of course, and it's certainly not supposed to be flashing.  Two, regardless of specifying very specifically what tiles to use with setTileAt, it's using a tile it shouldn't be, and it's driving me crazy.  I'm sure it's something stupid, so please point out how stupid I am being.

Hopefully someone can help me out!  Code is attached below!  Thanks.

So for my current project, shadows and light are a huge gameplay aspect.  I need to be able to detect when the player is in an area that is lit up (a radial area defines the light source, so a radial area would work best for detection as well) and some of the lighted areas overlap.

I'm trying to use distance to the center of the light source to define the "light value", because the farther from the center of the light source, the darker the light is.  When the player is within two areas that overlap, I need it to calculate the distance within both areas, again, the light value, and then put that into one number that I can use to determine how visible the player is.

I tried using the basic [absolute value of [(Actor1 X - Actor2 X) ^ 2]] + [absolute value of [(Actor1 Y - Actor2 Y)] ^ 2]] for each light source and then adding them into a game attribute, but the number just continually increases, and I would like to be able to define the detected area the same way I use the draw circle block for the light source (ie: a radius of 32 would be the same in both)

I really hope I'm making some sense, and if not, please let me know where I need to elaborate.  Thanks! :)

When I try to set an actor type, the pop-up menu to choose an actor type doesn't show up, and this java error shows up in my logs in reference to it.

java.lang.IllegalArgumentException: newSize must be lower than the image height
   at stencyl.sw.util.gfx.GraphicsUtilities.createThumbnail(
   at stencyl.sw.editors.snippet.vars.ActorChooser.<init>(
   at stencyl.sw.editors.snippet.vars.EditVariablePane.chooseType(
   at stencyl.sw.editors.snippet.vars.EditVariablePane.access$800(
   at stencyl.sw.editors.snippet.vars.EditVariablePane$8.actionPerformed(
   at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
   at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
   at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
   at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
   at java.awt.Component.processMouseEvent(Unknown Source)
   at javax.swing.JComponent.processMouseEvent(Unknown Source)
   at java.awt.Component.processEvent(Unknown Source)
   at java.awt.Container.processEvent(Unknown Source)
   at java.awt.Component.dispatchEventImpl(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
   at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
   at java.awt.Container.dispatchEventImpl(Unknown Source)
   at java.awt.Window.dispatchEventImpl(Unknown Source)
   at java.awt.Component.dispatchEvent(Unknown Source)
   at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
   at java.awt.EventQueue.access$000(Unknown Source)
   at java.awt.EventQueue$ Source)
   at java.awt.EventQueue$ Source)
   at Method)
   at$1.doIntersectionPrivilege(Unknown Source)
   at$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue$ Source)
   at java.awt.EventQueue$ Source)
   at Method)
   at$1.doIntersectionPrivilege(Unknown Source)
   at java.awt.EventQueue.dispatchEvent(Unknown Source)
   at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
   at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
   at Source)

It does not matter what behavior this occurs in, and only happens in one Stencyl game project.

So I'm having a bit of a complicated problem with Stencyl.

I'm attempting to implement randomized terrain generation for a game I'm working on.  Currently, I have the behavior to read a 2D array as a map and output it as tiles completed.  Where I'm having issue is a behavior to create a 2D array map that is generated by the perlin noise algorithm.  I've spent the last few days doing some research, and I haven't been able to make any progress.

Does the Stencyl API even support the math functions needed to calculate the algorithm?  Unless I was doing something wrong, which is likely, even with what little I got Stencyl to attempt to do, it was throwing errors.  Ideally I'd like to make it a full behavior that I can control with attributes, but for now I'd just like to get the dang thing to work at all.

Thanks in advance!

I have yet to figure out the "random" part of the map generation, but I was able to generate a blank map with default tiles into an array.  My particular problem is getting Stencyl to translate that array into graphics.  I know how setTileAt works, but how to call it for each entry in the array completely alludes me.  I've seen how to do it with Flixel but I can't get Stencyl to do the same thing because of the difference in API.  If anyone has any relevant code I could look at, that would help immensely as well.  I just need any help I can get right now! :P

Windows / Mac / Flash / HTML5 / Dwarf Miner [WIP] [On Temporary Hiatus]
« on: January 01, 2012, 08:24:31 am »
Dwarf Miner is on temporary hiatus.
See my most recent post in this topic for more details.

version 0.0.3

  After various attempts at figuring out what I wanted to make with StencylWorks, I sort of accidentally made what this game has slowly started to become.  Dwarf Miner follows a bit in the style of the old Apogee MS-DOS platformers from the 90's.  I have a rough idea of the back story, but essentially it's about a dwarf that has to collect gems.

  Seeing as how this is my first real foray into making a game beyond just fiddling around, some development has been slow, but I think I'm starting to get the hang of things.  But anyways, I think I will let the current version of the game speak for itself.  There is A LOT of work to be done, and nothing is permanent or final.

  I welcome all comments, critique, feedback, and questions.  Some input would be greatly appreciated. :D

Updates for v0.0.3
  • You can now attack with a pickaxe
  • Use this same pickaxe to mine for gems
  • Signs to help guide you
  • Updated graphics for trees, and new bushes!

Updates for v0.0.2.5
  • New title screen logo
  • Implemented health system
  • Added Goblin enemy
  • Updated player graphics
  • Death animation for player
  • Tweaked detection for player opening chests

I'm trying to limit the amount of a specific actor that can be on the screen at the same time.  To give an example, I'm working on a game where I have actors continuously spawning every few seconds just offscreen and moving towards the player.  I want to be able to limit the amount of these actors that can be alive at once so that the game does not lag, and because too many of these actors can make the game difficult as well.

I was trying to use an attribute that was increased by one each time of these actors is spawned, and checking that the attribute is less than an attribute that is defined as the maximum amount of allowed actors.

I cannot figure out how to get this to work easily, and I feel like I'm missing something simple.  The behavior I scripted for this is a scene behavior, and the behavior that broadcasts the actor's death is an actor behavior.  I can't seem to get them to hear messages from one another, unless I'm doing something wrong.

Pages: 1