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 - karlgoran

Pages: [1] 2 3 4
1
help / problems with flashdevelop
« on: Thu, Nov 21, 2013 »
it seems like flashdevelop has changed a bit since i used it the last time and the set up instructions at flash game dojo seem a bit out of date. When i try to set up an SDK going TOOLS ---> PROGRAM SETTINGS--> AS3 Context tab and then change the SDK path, the SDK path has been replaced with something called Installed Flex SDK's.

Another problem i'm having is that i get an error message window when i try to start the program that says:

 Value cannot be null.
Parametername: input

   vid System.Text.RegularExpressions.Regex.Match(String input)
   vid System.Text.RegularExpressions.Regex.Match(String input, String pattern, RegexOptions options)
   vid AS3Context.PluginMain.ValidateSDK(InstalledSDK sdk)
   vid AS3Context.PluginMain.ValidateSettings()
   vid AS3Context.PluginMain.HandleEvent(Object sender, NotifyEvent e, HandlingPriority priority)
   vid PluginCore.Managers.EventManager.DispatchEvent(Object sender, NotifyEvent e)

2
help / Making an Air app, what is the max resolution?
« on: Wed, Jul 25, 2012 »
If i make my game so it's supposed to be played as an AIR app, what kind of constraints should i consider when it comes to resolution? what about using 1600X1200?

3
I'm looking to have a collision system that works like in Zelda. When the player walks over an enemy he jumps back while the enemy doesn't move at all, right now the enemy starts moving at the same speed and direction as the player when i walk on it.

4
n.

right now if the player presses and holds the A button the attack animation will play over and over again. I want to make it so the player has to release the button and press it again for it to have any effect, just like when playing Zelda on snes. should it be a time based thing? if so how long? Can i detect if the key has been released?

5
what i want is that when the player moves with the directional arrows it should be possible to hit, for example the A button, and still move the character while the attack animation is showing and not the normal movement animation. also i want the complete attack animation to finish before it's cancelled, always, except if the player hits certain buttons. right now nothing i try is working, here is some code:

Code: [Select]
KeyInputObject.KeyInputHandling(FlxG.keys.UP, FlxG.keys.RIGHT, FlxG.keys.DOWN, FlxG.keys.LEFT, FlxG.keys.A);

this.velocity.x = KeyInputObject.xspeed;
this.velocity.y = KeyInputObject.yspeed;

   
    if (KeyInputObject.PlayUntilFinished == false)
{
   
play(KeyInputObject.Animation);
}

if (KeyInputObject.PlayUntilFinished == true)
{
play(KeyInputObject.Animation);
if (this.finished == true)
  {
  KeyInputObject.PlayUntilFinished = false;
  }
}


Code: [Select]

public function KeyInputHandling(UpArrowPressed:Boolean, RightArrowPressed:Boolean, DownArrowPressed:Boolean, LeftArrowPressed:Boolean, AButtonPressed:Boolean):void
{
NothingPressed = false;
UseFlamer = false;
if (!UpArrowPressed && !RightArrowPressed && !DownArrowPressed && !LeftArrowPressed && !AButtonPressed)
{
  NothingPressed = true;
  yspeed = 0;
  xspeed = 0;
if (this.facing == 1)
{
Animation = "idleup";
}
if (this.facing == 2)
{
Animation = "idleright";
}
if (this.facing == 3)
{
Animation = "idleright";
}
if (this.facing == 4)
{
Animation = "downwardrightidle";
}if (this.facing == 5)
{
Animation = "idlefront";
}
if (this.facing == 6)
{
Animation = "downwardleftidle";
}
if (this.facing == 7)
{
Animation = "idleleft";
}
if (this.facing == 8)
{
Animation = "downwardrightidle";
}
}



if (UpArrowPressed && !RightArrowPressed && !DownArrowPressed && !LeftArrowPressed && !AButtonPressed)
{
  yspeed = -200;
  facing = 1;
  xspeed = 0;
UseFlamer = false;
}
if (UpArrowPressed && RightArrowPressed && !DownArrowPressed && !LeftArrowPressed && !AButtonPressed)
{
 
  xspeed = 200;
  facing = 2;
  yspeed = -200;
  UseFlamer = false;
 
 
}

if (!UpArrowPressed && RightArrowPressed && !DownArrowPressed && !LeftArrowPressed && !AButtonPressed)
{
  Animation = "runright";
  xspeed = 300;
  facing = 3;
  yspeed = 0;
  UseFlamer = false;
}
if (!UpArrowPressed && RightArrowPressed && DownArrowPressed && !LeftArrowPressed && !AButtonPressed)
{
  xspeed = 200;
  facing = 4;
  yspeed = 200;
  UseFlamer = false;
  Animation = "rundownwardright";
 
 
}
if (!UpArrowPressed && !RightArrowPressed && DownArrowPressed && !LeftArrowPressed && !AButtonPressed)
{
   Animation = "runfront";
  yspeed = 300;
  facing = 5;
  xspeed = 0;
  UseFlamer = false;
}
if (!UpArrowPressed && !RightArrowPressed && DownArrowPressed && LeftArrowPressed && !AButtonPressed)
{
  xspeed = -200;
  facing = 6;
  yspeed = 200;
  UseFlamer = false;
  Animation = "rundownwardleft";
 
 
}
if (!UpArrowPressed && !RightArrowPressed && !DownArrowPressed && LeftArrowPressed && !AButtonPressed)
{
  Animation = "runleft";
  xspeed = -300;
  facing = 7;
  yspeed = 0;
  UseFlamer = false;
 
 
}

if (UpArrowPressed && !RightArrowPressed && !DownArrowPressed && LeftArrowPressed && !AButtonPressed)
{
  xspeed = -200;
  facing = 8;
  yspeed = -200;
  UseFlamer = false;
 
 
}




if (!UpArrowPressed && !RightArrowPressed && !DownArrowPressed && !LeftArrowPressed && AButtonPressed)
{
  xspeed = 0;
  UseFlamer = true;
  yspeed = 0;
  Animation = "basicattackright";
      NumberofFrames = 2;
  PlayUntilFinished = true;

 
}

}
}

}

6
help / Black part of the screen
« on: Tue, Jun 19, 2012 »


what is that black part? i want to get rid of it!

7
i would like to try a system where the camera doesn't scroll but rather hop to a new position when the player walks closely enough to the screen edge. how can i do this?

8
HI. I've got a problem getting the rumored debugging thing going, i'm using a swedish keyboard so i'm not sure that's why i can't press ~ to get it going.

9
help / variable not keeping it's value
« on: Mon, Jun 11, 2012 »
playstate.as has this code:
Code: [Select]
FlamerBound = new FlamerTemplates(false);

FlamerTemplates.as file looks like this:
Code: [Select]
public function FlamerTemplates(BoundingOrGraphic:Boolean)
{

    BoundingOrGraphics = BoundingOrGraphic;
     
 
}

override public function update():void
{

if (BoundingOrGraphics == false)
{
height = 0;
                                            }


When i start the game it enters the if statement in the update function of the flametemplate object, so far so good. When it's supposed to enter it a second time however, it doesn't, so i'm assuming BoundingOrGraphics doesn't have the false value anymore after the object has been added. How can i change this? I wanted to use this as a way to have a flamertemplates class that can either make a flamertemplate that shows a graphic of a flame or not show any flame, depending on if i put true or false in the

FlamerBound = new FlamerTemplates(false);

in the playstate code.

10
help / flamethrower collission box
« on: Sun, Jun 10, 2012 »
The player can fire a triangular flame at his enemies and i'd like the collision box to be triangular as well or at least do something do simulate a triangular collission box (several increasingly big collission boxes put after another?). Not sure how to program this though. Making 10 different objects with different collission boxes and then put them on each other when the player fires his weapon doesn't seem like a great idea.

11
help / Creating a wasp move a bit randomly
« on: Fri, Jun 8, 2012 »
I got this wasp enemy that i'd like to be moving around a bit like a real wasp before the player gets close enough to engage in combat. My thinking is to have arrays with x, and y cordinates for different movement patterns. Instead of giving values to these with some maths i've just started to do it the hard way ie [0,2,3,4,5] etc. Dumb to do this or am i saving valuable processor power? Is this generally how one programs enemy movement?

12
help / a little problem
« on: Thu, Jun 7, 2012 »
What i want to do is when the player press the A button a flame will shoot forward from his gun. The flame object is added in the playstate and i let my player object INHERIT (is this what inheritance is?) the Flame object.What i'm trying to do is move the flame object around on screen depending on where the player is, also making the flame object visible if the player shoots his gun and restarting the animation from the beginning. I've been trying to do that in the Player objects code.
 This is what the playstate code looks like.
Code: [Select]
player = new Player(FlameTemp);
add(player);

Then in the Player.as i can turn off if the Flame object is visible or not and i can change its position, BUT ONLY IN THE Player.as constructor. When i try to do it in the update function i get an error:
This works:
Code: [Select]
public function Player(FlamerTemp:FlamerTemplates)
{
FlamerTemp.visible = false;

}

The code below gives me the error (Fault] exception, information=TypeError: Error #1009:  Can't gain access to a property or method for the object reference zero)
:

Code: [Select]

override public function update():void
{
  if (FlxG.keys.A)
  {
    play("firefront");
DirectionalKeyPressed = true;
  FlamerTemp.visible = false;



  }
                              }

13
..binaryheader.

vid System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   vid System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   vid System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   vid PluginCore.Utilities.ObjectSerializer.InternalDeserialize(String file, Type type)
   vid PluginCore.Utilities.ObjectSerializer.Deserialize(String file, Object obj, Boolean checkValidity)

I tried reinstalling flashdevelop but got the same error. also reinstall java but i still get an error. not sure what to do, the other threads i've looked in regarding this problem doesn't apply to me (i don't have a .local directory and i can't find any flashdevelop related content in my documents and settings folder). running windows 7.

14
help / how to post the game online?
« on: Tue, May 29, 2012 »
I wanted to try and get some people at a message board the possibility to see that i can program and i have a little basic game that i've made. what is the easiest way of getting them to play it? how do i get the flixel game online and easy to play?

15
help / Animation/picture issue
« on: Sat, Dec 17, 2011 »
Hi. I have a picture that i've added to the game with different animations. when the graphic is shown i see the whole image with all the animiations in a line and not the individual animations played subsequently after each other. This has worked well so far with other objects and i can't see what i'm doing wrong.
Code: [Select]
package 
{
/**
* ...
* @author Anders
*/
import org.flixel.*;
public class SwordCollisionBox extends FlxSprite
{
[Embed(source='../explosion.png')]
public var EmptyCollisionBox:Class;
public var APressed:Boolean;
public function SwordCollisionBox(X, Y)
{
super(X, Y);
loadGraphic(EmptyCollisionBox, false, false, 256, 64);
addAnimation("explode", [0, 1, 2], 7);
play("explode");
}
override public function update():void
{
}
}

}

Swordcollision object is added in the playstates constructor and is then made visible when the player pushes the A button.

16
Hi. i have a very strange problem.
This code checks if the A key has been pressed
                         
Code: [Select]
                              if (FlxG.keys.A == true)
  {
APressed = true;


  }

it's at the top of my player.as update function. Further down in the update function i have checks for the combination of arrow keys the player is pressing down, like up and right arrow at the same time or just the up arrow and so forth. In all cases when i press some arrow keys and the A button at the same time, the program enters the if statement and APressed is set to true. When i press the down arrow and the left arrow + the A key however, the program doesn't enter the if statement and APressed remains false.

17
help / How to arrange keyboard input code?
« on: Thu, Dec 15, 2011 »
Hi. In my current program i look for which keys are pressed down in both my playstate and in the update function of my player class. Is this a good thing or is there some better way of arranging this?

18
help / collision problem
« on: Wed, Dec 14, 2011 »
Hi. I have an enemy that the player object can push around. I also want the player to be able to use his sword to hurt the enemy but without pushing the enemy in any direction when the sword collision box hits the enemy collision box. Right now when i do:

Code: [Select]
if (FlxG.collide(SwordCollision, EnemyBlood))
  {
  SwordCollision.x = 10;
  }
[code]

i can see that the swordcollision box collides with the enemies collision box but i don't want the enemy to move because of this collision (right now it does).

19
I've been trying to make an attack collision box appear in front of the player and i wanted to do this from my Player.as class. The problem is that i can't reach this attack collision box object from my Player.as code except in the constructor of the Player.as code and i need to be able to reach it in the update function.

so this works in my Player.as class:
Code: [Select]
public function Player(X, Y, SwordCollision:FlxObject)
{
SwordCollision.visible = true;
}

but when i try to make the SwordCollision graphic visible from the Player.as classes update function i get:
C:\Users\Anders\Desktop\project2\src\Player.as(43): col: 4 Error: Access of undefined property SwordCollision.
SwordCollision.visible = true;
^
Build halted with errors (fcsh).

[/code]

20
I was wondering how i could make this work. As of now i have a sword "swish" graphic that i would like to appear in front
of the players current facing every time he attacks and then dissapear after a short time. I don't want to just keep adding this graphic to the game but rather just have one that sees where the player object is located on the screen and then use that information to position itself in the right place when the player attacks.

Pages: [1] 2 3 4