I've been working on my 2D platformer for a while, and I'm running into a couple of problems. It seems to become laggy even when only about 25 entities need to do collision detection with the 8 walls in the area.
Only one thing to note: the BOOST_FOREACH(const Edge& edge, this->GetCollisonBoxEdges()) { sections actually aren't a loop, all players and enemies are basically a vertical line for purposes of hitting walls, so that's why there is some weird stuff in there (like assuming the edge is oriented a certain way, etc).
Still working with SDL2 and c++ my map collision is messed up since I implemented my Camera.
I do understand that everything has a relative Position on the Screen, depending on the camera.
Problem No. 1: The camera is not moving as fast as the Player, despite having the absolutly same velocity (4/-4)??? How can this be O_o
Problem No. 2: My tile collision is totally messed now. Probably its because of the difference between the Player Position and the camera :/ So if you can solve Problem no. 1, Problem number 2 might work out on its own :)
I'm still working on my Project and the next Problem has occured: How do I detect collisions on a tilebased map? My tiles are 16x16 and the map is based on the tutorial of [URL] ..... I really like this Approach because I can define for each tile of what type it should be (so a earth tile can be walkable and lead to a secret passage).
The first Number stands for what Kind of tile it should be (e.g. Grass, Earth, Water, Blank,...) and the number after ":" stands for the type of the tile (e.g. solid, walkable, do dmg to the Player,...).
e.g. 0:0 0:0 0:0 0:0 0:0 //No tile and walkable 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 0:0 1:1 1:1 1:1 1:1 1:1 //Grass tile and solid 2:1 2:1 2:1 2:1 2:1 //Earth tile and solid
It's working just fine with loading the Images, but i've got no clue about the collision. I've already read a lot of stuff on the Internet but I don't get how to Combine it the structure from above. For example lazyfoo describes the collision with one object like one wall. So how can I check the Player Position with each tile?
For now there's no camera, but I plan to implement one later...
I'm making a 2D Terraria-like (side-scrolling RPG with destroyable blocks) game with SFML 2.1, and I have no clue how to correctly implement collision detection. Meaning that I have been successful at making it work, but it's not clean and definitely not dynamic.
By example, I mean design wise. What parameters should collision functions take? Where should these functions be located? The same 2 questions for collision reaction. Since I have multiple things that need to collide with each other (player with enemy, player with items, enemy with items, enemy with enemy, player with player, etc...), and the world has to be treated differently, things get complicated. There is no block class, just a vertex array, so collision with the world is based purely on coordinates taken from that array in the world class, which, considering it's the world and not something like a player or an enemy, doesn't inherit from the same base class that they do.
I have made a simple 2d shooter (bird eye view) and want implementing the collision detection between the monsters and bullets. The problem is as follows
Each monster has locationX, locationY as coordinates. Each monster has a Rectangle representing its collision box, (if bullet inside rectangle then its a collision). Each bullet has locationX, locationY as coordinates as well.
pretty standard up till now.
each frame I need to check if some bullet collided with some monster.
the brutal force is to keep a list of all the bullets and monsters and to check the possibility of collision between all of them which takes O(#bullets * #monsters).
take a look at this project : [URL] i want to change this project for this purpose : when a USB PRINTER is connected show a message that tell us -> hey this is a printer. which part of this project should i change and how can i separate printer devices from the others?
note: if you are using visual studio 2010 or higher and get error for this line after conversion :
#define _WIN32_WINNT 0x403
just replace all of such these lines to stdafx.cpp file. means stdafx.cpp at last should be like this :
// stdafx.cpp : source file that includes just the standard includes // HWDetect.pch will be the pre-compiled header // stdafx.obj will contain the pre-compiled type information #define _WIN32_WINNT 0x403 #include "stdafx.h"
I actually want some latest algorithms, methods or techniques which can be used in plagiarism detection software for detecting the text plagiarism offline.
In the C++ book Programming: Principles and Practice Using C++, there's an example code like this for detecting repeated words:
Code: #include "std_lib_facilities.h" int main() { int number_of_words = 0; string previous = " "; // previous word; initialized to "not a word" string current; // current word while (cin >> current) // read a stream of words
[Code].....
The header file in there is sort of like a set of training-wheels for students who are complete beginners to the language; the function keep_window_open() is defined in there and it does just that on Windows systems where the output window closes too fast (in the case of the function, it's just like cin.ignore(), except it waits for you enter a character, like 'j', before it exits); programs on my Windows laptop work fine on Code::Blocks, but when I create a .exe file for them and double-click that file, it does actually close too quickly for me to be able to see the output (if it's a program like the generic "Hello World!" program that just outputs text to the screen and then exits - so all I see is the output window just flash-by really fast in those cases).
Anyway, as for the problem I'm having with the code: there are no error and compile- or link-time, but it does behave strangely at runtime, where the part inside the curly-braces of the while-loop doesn't execute at all.
I'm trying to write a program that detects deadlock. Some of the code I already tested in an earlier stage but at this point when I run the code it somehow gets stuck. I believe that it has something to do with a negative integer value. Anyhow, the program should still work if a negative integer comes up. Here's my code so far.
The program usually gets stuck after producing output displaying the "Available: " text. After that a list of tabbed numbers should appear, but it doesn't.
I don't think my processes are being created the way I want. I'm trying to create a fan of process (i.e. one parent with multiple children).
I want the parent to put together the final output image, and the children are supposed to do the edge detection on various regions of the image. Here is what I have:
I am trying to find the best way to detect a small symbol such as :
Just for testing features I tried to load these into SURF example that comes with EMGU and it does not pick it up... And I think the technology used for SURF is better for objects with more details and color gradients...
I'm receiving a char array consist of 8 characters, what I want to do is find the number of set bits in that array and then send it(total number) as a character to the transmitter so he can check, data is transmitted using serial port(RS232), where processing of data is done by DE0 FPGA.I've tried to use TestBit but the compiler doesn't know this function(I added #include "bit-manipulation.h" but it doesn't recognize this either) ...
-- the code of my project:
filed = open( "/dev/uart_0", O_RDWR ); if (filed < 0){ printf("the port can't be opened ");
I am writing an software that should be able to detect all keyboard inputs by the user. i.e., both hardware and software/on-screen keyboard.
This software is going to be written in a platform independent way and supposed to run on Windows, Linux, Android & iOS.
The idea is to capture the keyboard inputs from a low level, there by making sure that it doesn't miss any inputs even if it's a on-screen keyboard like in a mobile device.
I am looking at possible open source libraries that can be used.