Recent posts by sr2449 on Kongregate

Flag Post

Topic: Game Design / AS3 Sockets Help

Originally posted by PanisRahl:

the only thing your telling your code to write to your compiler is

trace("sending in username of " + username);

the “trace” is what tell it to put inputs in the compiler. The rest of ur lines jsut say socket.

idk, i dont really understand your problem. You have no explanation at all of anything other then its not writing. Im not even sure what u mean by its not writing.

I understand how trace works.
The problem I am having is that it’s not sending the information to the server (Other then the username).

 
Flag Post

Topic: Game Design / AS3 Sockets Help

I hope someone here knows..

 
Flag Post

Topic: Game Design / AS3 Sockets Help

Everything works up until this point. Here is the code on frame 2:
http://pastebin.com/t3jS6XML

Anyways my problem is that it writes the username, then after that it stops writaing. (It will still write stuff before it)

 
Flag Post

Topic: Platform Racing 2 / Everlasting Cowboys

I got a cowboy
..it was amazing
..fold me a cowboy

Originally posted by ScumPR2:

I should add that I am not gonna fold anyone who already has one.

Oh :(

 
Flag Post

Topic: Game Programming / Viberating Player Though The Ground

I replaced

//if (player.getRect(this).intersects(platformBlocks[i])) {

with
if (player.hitTestObject(platformBlocks[i])){

It gives me this error:
TypeError: Error #1034: Type Coercion failed: cannot convert flash.geom::Rectangle@2be97f71 to flash.display.DisplayObject.
at Demo_fla::MainTimeline/loop()

 
Flag Post

Topic: Game Programming / Viberating Player Though The Ground

When ever I run my game, the player vibrates when touching the ground, it seems only shrinking the player fixes this problem, but it also causes the player to glitch. How could I prevent this?


import flash.events.KeyboardEvent;
import flash.events.Event;
// some variabls to track the player’s speed
var speedX=0;
var speedY=0;
// loop though all platform objects to generate a platformBlocks
var platformBlocks:Array = new Array();
for (var i=0; i<numChildren; i++) {
if (getChildAt(i) is Limitations) {
platformBlocks.push(getChildAt(i).getRect(this));
}
}
// make variables to store key states
var kUp = false;
var kDown = false;
var kLeft = false;
var kRight = false;
// Listen for key presses and releases
stage.addEventListener(KeyboardEvent.KEY_DOWN, kD);
stage.addEventListener(KeyboardEvent.KEY_UP, kU);
function kD(k:KeyboardEvent) {
if (k.keyCode ==37) kLeft=true;
if (k.keyCode ==38) kUp=true;
if (k.keyCode ==39) kRight=true;
if (k.keyCode ==40) kDown=true;
}
function kU(k:KeyboardEvent) {
if (k.keyCode ==37) kLeft=false;
if (k.keyCode ==38) kUp=false;
if (k.keyCode ==39) kRight=false;
if (k.keyCode ==40) kDown=false;
}
// Make a looping function
addEventListener(Event.ENTER_FRAME, loop);
function loop(e:Event) {
// lateral movement checks
if(kLeft) {
speedX= -10;
player.gotoAndStop(“run”);
player.scaleX=player.scaleY*-1;
} else if(kRight) {
speedX=10;
player.scaleX=player.scaleY
player.gotoAndStop(“run”);
} else {
speedX*=0.5; // friction
player.gotoAndStop(“idle”);
}
// move player based on the above
player.x+=speedX;
// sidewards hit test
for (i=0; i<platformBlocks.length; i++) {
if (player.getRect(this).intersects(platformBlocks[i])) {
if (speedX > 0) { // moving left
player.x = platformBlocks[i].left-player.width/2;
}
if (speedX < 0) { // moving right
player.x = platformBlocks[i].right+player.width/2;
}
speedX=0; //kill the speed
}
}
// vertical checks
var jumpable = false;
// hit test
speedY+=1;
player.y+=speedY;
for (i=0; i<platformBlocks.length; i++) {
if (player.getRect(this).intersects(platformBlocks[i])) {
if (speedY > 0) { // moving down
player.y = platformBlocks[i].top-player.height/2;
speedY=0;
jumpable=true;
}
if (speedY < 0) { // moving up
player.y = platformBlocks[i].bottom+player.height/2;
speedY*=-0.5; // bounce off the celling
}
speedX=0; //kill the speed
}
}
// jump if possible
if (kUp && jumpable) {
speedY=-16; // jump height
}
vcam.x=player.x;
vcam.y=player.y;
}

 
Flag Post

Topic: Game Design / Multiple Linkage

var platformBlocks:Array = new Array();
for (var i=0; i<numChildren; i++) {
	if (getChildAt(i) is GrassBlock) {
	platformBlocks.push(getChildAt(i).getRect(this));
	}
}

This is a small part of the script. I want to know how to link more then just GrassBlock, like if I would like it to link both GrassBlock and IceBlock, and if there’s a way to link it as a group

 
Flag Post

Topic: Game Programming / Error in AS

It’s suppose to cause the object the the script is in to move to the top left corner and then back, instead it just goes to the top left corner. I haven’t really used AS in a few years, so I am rusty, anybody see my error?

onClipEvent(load)
{
	rotatespeed = 3;
	timer = 0;
	movedirection = 1;
	movebacktime = 100;
	movespeed = 10
}
onClipEvent(enterFrame)
{
	_rotation += rotatespeed;
	timer += 1;
	if(movedirection = 1)
	{
		_x -= movespeed;
		_y -= movespeed;
	}
	else
	{
		_x += movespeed;
		_y += movespeed;
	}
	if(timer >= movebacktime)
	{
		if(movedirection = 1)
		{
			movedirection = 2;
		}
		else
		{
			movedirection = 1;
		}
		timer = 0;
	}
}
 
Flag Post

Topic: War of the Web / Kong's Team is to Big

Kong is pwning all the other players. Now we don’t want all the other teams to quit. What do you think is the best thing to do here?

 
Flag Post

Topic: War of the Web / A guide

Oh cool, keep on the hard work, Huntlocker!

 
Flag Post

Topic: War of the Web / Best Strategy

Post good strategies here! Also, an image of your empire would be nice too! ;)

 
Flag Post

Topic: War of the Web / Problem with posting *Fixed

Yup, fixed! ;)

 
Flag Post

Topic: War of the Web / WotW Bug Reports

Post any WotW bugs you find, so Jiggmin can smash them! :3

 
Flag Post

Topic: War of the Web / War of the Web KonGuide

lol, because of the updates, etc, I am of the list, although I have that bonus on my Kong acc XD

 
Flag Post

Topic: Off-topic / Help

^

 
Flag Post

Topic: Off-topic / Help

Can some one give me a link for the program?

 
Flag Post

Topic: Off-topic / Help

@ Vegard I don’t have that program and I not to mention I don’t know the same language, but I suppose I could download it.

Originally posted by EPR89:

System32 has all your game files. If you delete it you will never be able to play games on your system again, neither Flash games nor any other game. Ultimately this will cause your system to get depressed and commit suicide. Do not, I repeat, DO NOT DELETE system32!

I didn’t. I saw that comment, but sometimes you know a troll comment when you see one.

 
Flag Post

Topic: Off-topic / Help

On Tinychat I want other people to hear what my computer would normally produce out of it’s speakers. How would I do this (I want external sounds to be produced as internals [As if I was speaking in to a micro-pone])?

 
Flag Post

Topic: Game Programming / Multiple Hit Test for one Object

Originally posted by Draco18s:
Originally posted by sr2449:

I also need some help on the wall part.

<br />
	if(this.hitTest(_parent.Wall)){<br />
		AcelX = 0;<br />
		AcelY = 0;<br />
	}<br />

And what is it that this part does or doesn’t do that needs changing?

I want the Hit test to work on multiple objects, is their a way that I can do this without using arrays?

You can’t. Moving on…

I need help using arrays on this then.. :/

 
Flag Post

Topic: Game Programming / Multiple Hit Test for one Object

I also need some help on the wall part.


if(this.hitTest(_parent.Wall)){
AcelX = 0;
AcelY = 0;
}

 
Flag Post

Topic: Game Programming / Multiple Hit Test for one Object

onClipEvent (load)
{
    var AcelX;
    AcelX = 0;
    var AxelY;
    AcelY = 0;
	var Tuch
	Tuch = 0;
	this._x = _parent.Spawner._x;
	this._y = _parent.Spawner._y;
}
onClipEvent (enterFrame)
{
    this._x = this._x + AcelX;
    this._y = this._y + AcelY;
	if(this.hitTest(_parent.Holder)){
		AcelX = 0;
		AcelY = 0;
	}
		if(this.hitTest(_parent.Hurt)){
		this._x = _parent.Spawner._x;
		this._y = _parent.Spawner._y;
		AcelX = 0;
		AcelY = 0;
	}
	if(this.hitTest(_parent.Bouncer)){
		AcelX = -AcelX
		AcelY = -AcelY
	}
	if(this.hitTest(_parent.Wall)){
		AcelX = 0;
		AcelY = 0;
	}
	if(this.hitTest(_parent.Ice)){
		AcelX = AcelX*1.2;
		AcelY = AcelY*1.2;
	}
	if(this.hitTest(_parent.Hater)){
		Tuch += 0.1;
		AcelX += Tuch;
		AcelY += Tuch;
	}
	else
	{
		Tuch = 0;
	}
	if(this.hitTest(_parent.Goal)){
		_parent.nextFrame();
		_parent.Player._x = _parent.Spawner._x;
		_parent.Player._y = _parent.Spawner._y;
		AcelX = 0;
		AcelY = 0;
	}
}
on (keyPress "<Left>")
{
    AcelX = AcelX - 3;
}
on (keyPress "<Right>")
{
    AcelX = AcelX + 3;
}
on (keyPress "<Up>")
{
    AcelY = AcelY - 3;
}
on (keyPress "<Down>")
{
    AcelY = AcelY + 3;
}

I want the Hit test to work on multiple objects, is their a way that I can do this without using arrays?

 
Flag Post

Topic: Everybody Edits / Everybody Edits pro?

Originally posted by cjocj:
Originally posted by bobflob:

Yeah it’s on the official website but I can’t log in to the website because I don’t know the e-mail I used. And it’s not in the shop. Thanks again :P

its at SHOP in FEATURED it says kongregate pro

I don’t think it’s featured any more…Just look around the shop…If you don’t find it, your to late, and have to buy it on EE witch you can’t. .

 
Flag Post

Topic: Game Programming / Small as2 script help..[Solved]

Originally posted by qwerber:

you shouldn’t be using the stage for a background for anything. Use a display object like UG said.

Thanks! :)

 
Flag Post

Topic: Game Programming / Small as2 script help..[Solved]

Originally posted by UnknownGuardian:

Draw a rectangle at the back and make it filled with that color. Or change the color from the .fla I think you can. Might be AS3 fla only though.

Are those the only way? And yes, I can change it from the .fla, but it would change the background on every frame.

 
Flag Post

Topic: Game Programming / Small as2 script help..[Solved]

Is there a way to change the stage’s color in as2?