phore_eyes
427 posts
|
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
Platformer Trouble.
It’s annoying for other people to read questions that could easily be solved by using google.
|
|
|
phore_eyes
427 posts
|
|
|
|
phore_eyes
427 posts
|
|
|
|
phore_eyes
427 posts
|
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
square following player
I wish the simple solution would work but it won’t for what I need it for.
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
square following player
I have a square which I want to stay at the top right corner of a rectangle (the player). The problem is that when the player moves instead of staying right on the corner the square falls behind the rectangle (when you stop it gets back into position). I know I can apply the xspeed from the player to the square but I’m wondering if there is a simpler way?
This is the code for the square:
onClipEvent (load) {
a1 = Math.atan(60/35);
a4 = -a1;
}
onClipEvent (enterFrame) {
radians = Math.PI * root.player.rotation/180;
this.x = 34.73 * Math.cos(radians+a4)+(root.player.x);
this.y = 34.73 * Math.sin(radians+a4)+(root.player.y);
}
|
|
|
phore_eyes
427 posts
|
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
Trig and rotating rectangles
Got help from over on mochi fourms and for anyone wondering:
onClipEvent (load) {
a1 = Math.atan(60/35);
}
onClipEvent (enterFrame) {
radians = Math.PI * root.player.rotation/180;
this.x = 34.73 * Math.cos(radians+a1)+(root.player.x);
this.y = 34.73 * Math.sin(radians+a1)+(root.player.y);
}
is the code I used. (It follows the bottom right corner but making it follow the others is very simple)
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
Trig and rotating rectangles
That won’t work for my purposes but thanks anyways.
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
Trig and rotating rectangles
Ok I’m just posting this before I go to bed so I won’t be able to reply right away. First off I’m using AS2, I have a rectangle (60p high and 35p wide) that rotates on the screen and I need squares to stay on each of it’s four corners unfortunately I haven’t been able to figure out how to do this.This is the code I have in one of the squares:
onClipEvent(enterFrame){
this.x = Math.cos(root.player.rotation / 60) * 34.7 + _root.player.x;
this.y = Math.sin(root.player.rotation / 60) * 34.7 + _root.player.y;
}
As far as I can tell that should align it to the upper right hand corner but instead it aligns to the right of the rectangle. Any help with this would be really great because I’ve been working on it for awhile now.
|
|
|
phore_eyes
427 posts
|
Topic: Kongregate /
10,000
it’s above 2.5
|
|
|
phore_eyes
427 posts
|
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
New game (FGL only)
Anyone have any feedback?
|
|
|
phore_eyes
427 posts
|
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
New game (FGL only)
Just about done my new game monotone and was wondering if anyone could give me some feedback.
game can be found here: http://www.flashgamelicense.com/view_game_id=3231
thanks for any feedback.
(must be registered at FGL to view it)
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
any ideas...
I want to make it so that when the player goes in between two enemies while they are with in 100px of each other a variable goes up by one. Originally I was going to have it draw a line in between the enemies when they were within 100px of each other and then perform some kind of collision detection on it but that doesn’t work. So does anyone have any ideas on how i could do this?
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
line hitTest
that wouldn’t work because it would still be checking the bounding box not the line itself.
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
line hitTest
the player is a square 20 px by 20px the more accurate the better
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
vector projection
I have a line and I need to use a hitTest on it and to my understanding to do that I need vector projection (so that it’s not just the bounding box) I’ve looked at the create a flash game like deflection tutorial by Emanuele Feronato (which is basically exactly what I need) but I can’t figure out what part of the code the hitTest is.
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
line hitTest
I have a line that goes in between the two enemies and I want to check if the player is hitting it, it’s not possible to just use a normal hitTest because when I do that it takes the whole bounding box of the line (And i want just the line). Any ideas on how it could be fixed?
|
|
|
phore_eyes
427 posts
|
|
|
|
phore_eyes
427 posts
|
Topic: Game Programming /
drawing a line to connect two mc's
I’m just wondering why my code isn’t working:
onClipEvent (enterFrame){
var Dist = GetDistance();
if(Dist<100){
this.createEmptyMovieClip(“line_mc”, 10);
line_mc.lineStyle(10, 0×000000, 100);
line_mc.moveTo(this.x, this.y);
line_mc.lineTo(root.enemy2.x, root.enemy2.y);
}
function GetDistance(){
return Math.sqrt((this.x-root.enemy2.x)*(this.x-root.enemy2.x)+(this.y-root.enemy2.y)*(this.y-root.enemy2.y));
}
}
I want it to draw a line connecting itself and the movieclip enemy2 and as far as I can tell it should but it doesn’t… just wondering if anyone can tell me why it’s not working and/or how to fix it.
|
|
|
phore_eyes
427 posts
|
Topic: Kongregate /
Is this true?
i think people are just saying you do so that people will stop doing it… but i dont really play kongai so i dont know.
|
|
|
phore_eyes
427 posts
|
|