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

Pages: 1 2 3 ... 5
1
Resolved Questions / Re: Need help in making bot AI
« on: September 13, 2011, 07:37:17 am »
[...] but don't know how to make AI that will pick one or two enemies that placed most closer to player, from group of enemies on screen, some times it's 20 monsters in one time.
1) Create a Number attribute named Distance. Right before the loop, set it to a big number.

2) Create an Actor attribute named ClosestEnemy.

3) Use a loop block to iterate over a group or type of actors (the enemies).

4) For each enemy, compute its distance to the player. If this distance is lesser than Distance, then set ClosestEnemy to the enemy.

5) When the loop is over, ClosestEnemy contains the closest enemy to the player. Use it to shoot.

Don't set it to 'a big number'... set it to the distance to the first Enemy in the group and set it as the closest enemy. What will happen if this 'big number' is smaller than the distance to all the enemies?

2
Resolved Questions / Re: How to make an actor spin by 90 degrees?
« on: September 13, 2011, 02:32:19 am »
How exactly do you calculate the difference between 89.9 and 90 degrees? :D

3
Ask a Question / Re: Tiles Problem
« on: September 12, 2011, 06:04:14 am »
When you are making slope - the collision shape should be smaller than the image.

There are a lot of articles online :) The idea is that when you have slope only the corner of the collision box of your character will touch the slope. But usually in the corner there's nothing and it looks like your character flies :) Sometimes when you have circle as collision shape for your character - it looks better.

4
Ask a Question / Re: Key combined cheat code?
« on: September 11, 2011, 08:10:43 am »
You have to delete the first character - not the last :)

Something like

[set keysString to part of keysString starting at 1 end keysString.length] 

And maybe Stencyl shouldn't force people to fill all the optional parameters of a function. This sux - if you don't add string.length as second parameter to substring.... it does the same. 

5
Ask a Question / Re: Key combined cheat code?
« on: September 11, 2011, 05:15:03 am »
It doesn't matter if you store the info in array or string. The other things are more important. I clear this 'string' when 1,5 sec no key was pressed. The idea is to press the keys fast and do the whole sequence :) The other thing is... when you play - you press a lot of keys. In one point you decide to enter the cheat... but... if you don't clear this string - it will have other shits from your previous input that will never match your cheat - that's why I check - if the number of keys is the same - compare. If the 2 strings aren't the same - remove the first char from the string where you store the keys pressed.

6
Game Ideas / Re: Dynamic Multiplayer RPG/Board Game (Working Concept)
« on: September 10, 2011, 11:09:20 pm »
http://www.mondocarto.com/

Look at this :) You need to find 4 keys and bring them to the final spot :) The other ideas look different but maybe you can get some ideas from it :)

7
Ask a Question / Re: Translating X and Y normals to degrees?
« on: September 10, 2011, 10:42:54 pm »
X,Y define a point - for angle you need 2 lines. What angle do you want to find?

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/Math.html

Look at asin() - it can help you :)

8
Ask a Question / Re: Key combined cheat code?
« on: September 10, 2011, 02:54:57 pm »
Code: [Select]
var  keyStack:Array = new Array();

var  cheatStack:Array = new Array();

// fill the stack with key codes


var t:Timer = new Timer(1500);
t.addEventListener(TimerEvent.TIMER, clearStack);
t.start()

function clearStack(te:Event):void {
    keyStack = null;
    keyStack = new Array();
}

stage.addEventListener(KeyboardEvent.KEY_UP,
function keyHandler(event:KeyboardEvent):void {
            t.reset();
            t.start();
            keyStack.push(event.keyCode);
            if(keyStack.length == cheatStack.length){
            for(var i=0;i<keyStack.length;i++){
                 if(keyStack[i]!=cheatStack[i]){ keyStack.shift(); return; }
            }
            cheatFunctionCallGoesHere();
}
           
});




This should be something like basic code for key combos. But I'm not sure if you need the timer for konami codes. I don't know if it works - you'll need some imports etc. I wrote it here :) But if you can understand the code - you'll be able to make it in stencyl too :)

Good luck :)

9
Ask a Question / Re: multiplayer?
« on: September 10, 2011, 02:55:22 am »
It is possible. Stencyl just offers graphic version of Flixel. AS3 supports socket connections. You'll need a server. (Even if one of the players will be 'the host' of this game - you'll still need at least http server to match the players).

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/XMLSocket.html

10
Game Ideas / Re: Click The Buttons
« on: September 08, 2011, 11:21:00 am »
What is the idea of this game? Just pressing circles? Maybe you should at least show what time we needed to press all the circles :)

11
Game Ideas / Re: Waypoints
« on: September 08, 2011, 04:07:50 am »
http://en.wikipedia.org/wiki/Stack_%28data_structure%29

You can use array + pop()

Just store x,y :)

12
Game Ideas / Change graphics quality button
« on: September 08, 2011, 03:45:34 am »
Can someone tell me how this works and how to implement it?

Does it work only with vector graphics or? Maybe you change the buffer size for your bitmaps?

13
It's problem with the mp3 format. But you can fix it :)

You'll ask how?

Just don't be lazy :) Don't use stencyl's 'loop' feature :) Make your own.

You can play multiple sounds at the same time. If your mp3 is 2:02 and it has 2 seconds pause - you'll have to
1. Start playing your mp3
2. Start a timer that will play the same mp3 again after 2:00 :)

14
Ask a Question / Re: How to make a TD (tower defence) game?
« on: August 27, 2011, 03:25:45 pm »
Ahh I've been working on a kit but I'm having trouble with pathfinding for the monsters to do it accurately its kinda hard.

If it's not maze where you can block the way... you just have to put some regions in the corners where the creeps should change their direction. And then make an Array with this regions. Every creep will have an internal counter - when it enters the first region - counter++, start moving to Regions[counter].

15
Ask a Question / Re: How to make a TD (tower defence) game?
« on: August 27, 2011, 07:27:01 am »
1st. You have to start thinking
- What is Tower Defence
- What things should my game have
Just break everything to smaller things.
2nd. Try to make any of this small things

And... what kind of TD? Will the player have the ability to make maze or you'll build around the path?

Pages: 1 2 3 ... 5