Hey everyone,
I'm making small interactive games in flash to learn AS3, now I ran into a problem that I need some help with.
I need to check the collision between the player and the wall which is normally simple using the hitTestObject function.
But now I made a wall object totally surrounding the player with corridors and turn, a col...
How do you detect a collision between ball & bricks in a brick breaker game?
...
I'm not very experienced with Java, just started a couple weeks ago, but I have a simple applet that has two user controlled balls, drawn through java.awt and I need a way to detect a collision with between them. I have an algorithm for detecting collision with the walls:
while (true){
if (xPositon > (300 - radius)){
...
My current setup is only useful once collision has been made; obviously there has to be something better than this?
public boolean CollisionCheck(Rectangle rect1, Rectangle rect2) {
if(rect1.intersects(rect2)) {
return true;
}
return false;
}
How can I do preemptive collision detection?
...
How exactly do you implement collision detection? What are the costs involved? Do different platforms(c/c++, java, cocoa/iphone, flash, directX) have different optimizations for calculating collisions. And lastly are there libraries available to do this for me, or some that I can just interpret for my platform of choice?
As I understan...
I am working on a simple 2D openGL project. It contains a main actor you can control with the keyboard arrows. I got that to work okay. What I am wanting is something that can help explain how to make another actor object follow the main actor. Maybe a tutorial on openGL. The three main things I need to learn are the actor following, col...
I'm using Javascript to embed a flash file into a website which I then need to remove once it's completed playing.
Is there a way to do this in plain Javascript? Or will it require a callback type function to be added into the Flash file itself?
How do I code this? ._.
Javascript:
jQuery('body').append('<embed id="flashIntro" width="...
I'm using Adobe Flash CS4.
The language is Action Script 3
In my library I have 2 items:
player
wall
the player object is already functioning correctly with moving him around.
Now when I place multiple wall objects into the stage (wall = 32x32 px) I want to prevent the player from moving when he walks into a wall.
I've tried giving...
I'm doing a scene using openGL (a house). I want to do some collision detection, mainly with the walls in the house.
I have tried the following code:
// a plane is represented with a normal and a position in space
Vector planeNor(0,0,1);
Vector position(0,0,-10);
Plane p(planeNor,position);
Vector vel(0,0,-1);
double lamda; // this is...
Hi. I'm following an XNA tutorial and have the following code for collision detecting (detecting when a bullet collides with a target). Basically I'm looking to increment a score variable to display the score to the screen without re-writing the whole program. No matter where I place it in this method it seems to start incrementing from ...
How can I programatically detect whether or not two triangles touch each other, given their vertices on a 2D coordinate plane? This includes touching points or edges, as well as if one triangle is completely "inside" the other one.
...
So I'm trying to implement a test where a oval can connect with a circle, but it's not working.
edist = (float) Math.sqrt(
Math.pow((px + ((pwidth/2) )) - (bx + (bsize/2)), 2 ) +
Math.pow(-((py + ((pwidth/2)) ) - (bx + (bsize/2))), 2 )
);
and here is the full code (requires Slick2D):
import org.newdawn.slick.AppGameContainer...
I would like to know if is there any way to determine if a cone is intersecting with a (finite) line segment. The cone is actually a circle located at P(x,y) with theta degree field of view and radius r:
I'm trying to do it in C# but I don't have any idea how to that, so for now this is what I'm doing:
Check if the line segment is i...
I have been experimenting HTML5 canvas by coding basic mind-mapping application. I have tried to find out if there is any javascript API used for managing object in canvas like collision detection between images or shapes.
I think it is not a good idea to write my own since there might be some good API around.
Anyone have clue or some in...
I am trying to program a web game in Jquery with the GameQuery plugin, problem is the GameQuery plugin has no support for per pixel collision detection only collision detection with bounding boxes. Is it possible to implement per pixel collision detection in javascript/Jquery?
I have a world map with countries and a player which is mov...
Hi, I know I've probably posted three questions related to this then deleted them, but thats only because I solved them before I got an answer. But, this one I can not solve and I don't believe it is that hard compared to the others. So, with out further ado, here is my problem:
So I am using Cocos2d and one of the major problem is they...
Does anyone know what the ddx and ddy values do in the AABB ray intersect algorithm? Taken from the following site http://www.blitzbasic.com/codearcs/codearcs.php?code=1029 (show below).
Local txmin#,txmax#,tymin#,tymax#
// rox, rdx are the ray origin on the x axis, and ray delta on the x axis ... y-axis is roy and rdy
Local ddx# =1.0...
So, after hours of Googling and reading, I've found that the basic process of detecting a collision using SAT is:
for each edge of poly A
project A and B onto the normal for this edge
if intervals do not overlap, return false
end for
for each edge of poly B
project A and B onto the normal for this edge
if intervals do n...
I am seeking a good algorithm detecting if a moving ball is touching either a static wall or a static target. A classic Firing game logic. Anyone seen a good algorithm other than just loop them all?
EDIT: i have no idea which is the best solution, BSP tree or grid based calculation, but my implementation will be on javascript and contr...
I've been coding in c++ and java entirety of my life but on C#, I feel like it's a totally different animal.
In case of hash collision in Dictionary container in c#, what does it do? or does it even detect the collision?
In case of collisions in similar containers in SDL, some would make a key value section link data to key value s...