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.


Messages - bpercevic

Pages: 1 ... 3 4 [5]
81
help / Re: building issues
« on: Sat, Oct 9, 2010 »
thanks anyway,

any way of tracing where the swf is being built in flash develop?

82
help / Re: building issues
« on: Sat, Oct 9, 2010 »
absolutely nothing.  when i go to the bin-debug folder and play the swf directly or the html wrapped file its still just the old version of the game.  i feel like i must have changed something in the properties of the project but i've gone back and rechecked everything and i cant find it at all.

im using flex builder on mac just in case that information helps

83
help / building issues
« on: Sat, Oct 9, 2010 »
something seems to be wrong with flex builder, or my project.  i had a project i was working on over the summer that i havent touched until yesterday.  now, whenever i make a change to the code, save everything, and run the game it plays whatever my project was over the summer, none of my current changes ever go through.  i can't figure out at all what is wrong. 

tried:
-relaunching flex builder
-restarting comp
-reimporting project

any clues?

84
help / Re: Flash Builder 4
« on: Thu, Jun 10, 2010 »
just follow tim seifers getting started.

http://wiki.github.com/AdamAtomic/flixel/seifer-tims-tutorial#starting

you just need to make sure that the flixel source folder you downloaded is in the same folder as your game.  if you have a project started, right click on the project and click properties and go to build path and add the folder that holds the flixel source code.

85
help / Re: collision help [SOLVED]
« on: Tue, Jun 8, 2010 »
ok i got it.  in the base Level class where i initiated a group for shapes, i wasnt calling shapes.update() and now collision works.

86
help / Re: collision help
« on: Tue, Jun 8, 2010 »
ohh that makes sense.  well i did change the code, and the object is pushable but only from the bottom.  if you try left/right the player goes right through it and from the top its glitchy sometimes he goes through sometimes he pushes.  heres the swf:
http://megaswf.com/view/104938430398318b8a18102ba79cf3fc.html

the new code:
Code: [Select]
public function LVL_1(X:Number=10, Y:Number=10)
{
initLevel(0xffc7b29a, bg, mg, fg, data_tiles, church, 0, 96, 120);

// add objects
shape1 = addShape(40,80,20,20,0xffff0000);
super.create();
}

override public function update():void
{
checkDoor(door1, lvl2);
shapes.collide(p);
p.collide(shapes);
super.update();
}

i wasnt sure if it should be shapes.collide(player) or p.collide(shapes) i tried them separate and both together but i get the same result.

87
help / collision help
« on: Mon, Jun 7, 2010 »
hey everyone,
im having trouble dealing with collisions. ive searched the forum and didnt really find anything that helped me.  i made doors using collisions that transfer you to other states and that works fine, but when i draw objects to collide with (other than the map tiles) i run into some trouble. heres the link so you can see whats happening:

http://megaswf.com/view/35c8cad9f3dbd0e11eed56ebd892167e.html

the green are doors, they work.  the brown and red squares are what arent working right.  the brown is a stationary object and its not supposed to move upon collision, but if you move into it a few times it budges by one pixel and the old position is not re-rendered so it looks like its getting bigger.  the red is supposed to be a movable object, it actually does move with the player but the player goes halfway through it before it moves and then eventually all the way through it.  i want the brown not to move at all, and the red to move but without the player sliding through it. code below.

This is for my level class, basically i made Level extend FlxState and it just has functions for drawing the map, adding objects, and initializing camera/controls.  
Code: [Select]
package
{
import org.flixel.*;

public class Level extends FlxState
{
// map definitions : list all map layouts and tiles to use
[Embed(source="data/tiles.txt", mimeType="application/octet-stream")] public var level_1:Class;
[Embed(source="data/tiles2.txt", mimeType="application/octet-stream")] public var level_2:Class;

[Embed(source="data/tiles.png")] public var data_tiles:Class;

// pre-definitions
public var map:FlxTilemap;
public var p:Player;
public var doors:FlxGroup;

//testing
public var shapes:FlxGroup;

public function Level():void
{
// handle main
doors = new FlxGroup();
add(doors);
shapes = new FlxGroup();
add(shapes);
}

override public function update():void
{
// handle controls for shooting
p.update();
}

public function initMap(level:Class, tiles:Class):void
{
map = new FlxTilemap();
map.loadMap(new level, tiles, 8, 8);
map.collideIndex = 4;
add(map);


}

public function makeShape(X:Number=0, Y:Number=0, W:Number=1, H:Number=1, C:uint=0xFF597137):void
{
shapes.add(new Shape(X,Y,W,H,C));
}

public function addShape(shapeToAdd:Shape):void
{
shapes.add(shapeToAdd);
}

public function addDoor(doorToAdd:Shape):void
{
doors.add(doorToAdd);
}

public function addPlayer(X:Number, Y:Number):void
{
p = new Player(X,Y,0xff123cde);
add(p);
}

public function changeBG(bg:uint):void
{
FlxState.bgColor = bg;
}

public function initCamera():void
{
FlxG.follow(p);
FlxG.followBounds(0,0,map.width-8,map.height); // -8 cuz camera overlaps map by 8px
map.collide(p);
}

public function initControls():void
{
if(FlxG.keys.justPressed("F") && p.dead==false) { FlxG.flash.start(); }
}

public function checkDoor(doorNum:FlxObject):void
{
//FlxU.overlap(p, doorNum, resolve);
}

public function resolve(player:Player, door:Shape):void
{
FlxG.quake.start();
//FlxG.state = new LVL_2();
}
}
}

A few functions are overridden in the LVL_1 class like checkDoor and resolve.  This code is just level 1
Code: [Select]
package
{
import org.flixel.*;

public class LVL_1 extends Level
{
public function LVL_1(X:Number=10, Y:Number=10)
{
initMap(level_1, data_tiles);
changeBG(0xffeeeeee);
addPlayer(X,Y);
makeShape(20,80,10,10,0xffff0000);
super.create();
}

override public function update():void
{
// initialize
initControls();
initCamera();

// add objects
var firstDoor:Shape = new Shape(50,80,10,10);
addDoor(firstDoor);
var thing:Shape = new Shape(30,60,10,10,0xff736357);
addShape(thing);

shapes.collide(p);
p.collide(shapes);

super.update();

checkDoor(firstDoor);
}

override public function resolve(player:Player, door:Shape):void
{
FlxG.state = new LVL_2();
}

override public function checkDoor(door:FlxObject):void
{
FlxU.overlap(p, door, resolve);
}
}
}

so im wondering if the "shapes.collide(p)" is not meant to be used like that. (although without that player just moves right through the objects)  so i have no idea what to do.  is my code wrong?

thanks in advance this has been killing me for the past few days i just cant wrap my head around what to do.

Pages: 1 ... 3 4 [5]