Yes, it's rounding down.
Type: Posts; User: godly 20
Yes, it's rounding down.
Is there a function or an algorithm to round up float numbers to 2 digits after the radix point (comma).
Example: 3.1457 ->Rounds up to-> 3.14
For those of you who don't know what a radix point is:
In mathematics and computing, a radix point (or radix character) is the symbol used in numerical representations to separate the integer part...
Include the string.h library and declare the array as a string. By doing this you will have a multi-character for each position of the array. :)
You didn't ask a question, but i think i understood what you need anyways. Basically you need an array that holds in each position a multi-character. If yes then include the string library and...
I'm currently coding a very basic space shooter with the Allegro Library and Dev-C++. However I can't seem to figure out how to make the background scroll on the y axis and this thing has been...
From what I understood you are trying to make a program which asks you for the size of an array which will contain strings. In that case try with this:
#include <iostream>
using namespace std;...
It shuts down immediately, yes, but it does that with any key while it's only supposed to open/close when the "I" key is pressed. However I've solved this problem by making a fixed sidebar in which...
I did this:
int r;
if(key [KEY_ENTER])
{
r=(rand()%10) & 1);
if(r%2==0){
...
I'm sorry but I have basically no experience on Windows Forms programming. I just made a few things following tutorials just for fun so, I can't answer your question.
Thats something I recovered from a text based game I made long ago. The concept is the same.
How can I generate random numbers correctly in Allegro?
I need to generate random numbers for a function in my game. If the number generated is even the player gets an item, if its odd it fails. At the moment my character needs to cut down some wood. I...
Done. Thanks for pointing it out. Didn't realise that it could be offensive to someone.
Hey there. I'm currently programming a small 2D, RPG game and today I have included a function which opens up an inventory.
void OpenInventory()
{
if(key [KEY_I])
{
...
I made a very basic web browser not too long ago. I used Microsoft Visual Studio C++ 2010 (2008 is basically the same). There is actually a pre-built web browser box in the "tools box". You should...
The cout at the bottom of the main work perfectly. They're just there because they print on a separate dos widnow the position of the character in the x and y coordinates.
Ok, I put the code you...
#include <allegro.h>
#include <iostream>
using namespace std;
BITMAP* ground;
BITMAP* water;
BITMAP* tree;
BITMAP* rock;
BITMAP* character;
BITMAP* buffer;
BITMAP *backbuffer;
If it was that easy I wouldn't have posted this question here don't you think? I have tried to write it on anything but it still doesnt work. Atm I have a buffer, a backbuffer and the screen. And it...
Hi. I'm currently programming a small 2d game usign the allegro library. I need the game to print out a few messages. I tried with the "textout()" function but apparently it the text is drawn undea...
....
Ok so this is the image which contains all possible movements:http://dc251.4shared.com/img/7j1ytD2n/0.07157377207553117/sprite-anim2.bmp
And this is the code that moves the sprite:
if(key...
You should use a multi-dimensional array.
Thank you so much! It works perfectly! Anyways now I'm going to add physics/collisions so the character doesnt walk on water, nor on the other objects. After that I will introduce a basic game engine...
I have included everything you need into a zip file. You can download it here: Allegro_game.zip
By the way, i use Dev-C++ v.4.9.9.2
Doesn't work...it blackscreens and crashes :eek: