Jump to content
  • Advertisement

francoisdiy

Member
  • Content count

    437
  • Joined

  • Last visited

Community Reputation

118 Neutral

About francoisdiy

  • Rank
    Member

Personal Information

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. francoisdiy

    Problem with sleep

    It worked for me. So for you falling asleep is always a problem... this doesn't hold for everyone, though. I actually get better sleep now that when I was younger. (I don't know what's up with this but everytime I try to give advice on how to fix a problem people always want to go the other way. That's what I don't get.)
  2. francoisdiy

    Problem with sleep

    Yeah, but that's once in a while. I'm active all the time. 40 is still not very old. It has to be food. I'm 100% on that. Adding fresh vegetables to your diet makes a huge difference in everything! Like, for example, beets clean you out and make you deal with stress much better even building up confidence!
  3. francoisdiy

    Problem with sleep

    I I do lead a pretty active lifestyle. I ride my heavy bike everywhere, including to work, and even carry it uphill on the way to places as it is sometimes too muddy or steep to ride up. I also walk quite a bit when not going long distances. I ride in the winter too when it is icy and cold - just as active as I was when I was 20!
  4. francoisdiy

    Problem with sleep

    I'm 30. But that's not too old so I would think you are around the same age. Sleep should be a sure thing up until old age. The lack of falling asleep means something is not working right. Doctors won't tell you but it usually means your gut is not producing the necessary neurotransmitters that your brain needs - like melatonin. It is very important to eat vegetables both raw and cooked. That take-out food does none of us good and I don't buy takeout anymore for that reason. Sleep is much less of a problem now than when I was 20 as I would wake up in the middle of the night despite not having stress. I think it was food.
  5. Currently, I'm coding the memory mapper for the interpreter - the routine that let's the interpreter talk to SFML in order to do I/O. It is kind of like a driver or something like that. Here I show how to read/write values to the mapper. // Basic Memory Map // // your program // sprite register // sound register // music register // text register // signal register // camera register // collision register // level register // progress register void Cclsh::Rmemory_mapper(int address, std::string field, Fvalue data) { int prgm_low = 0; int prgm_high = prgm_low + this->memory_size; int sprite_addr = prgm_high; int sound_addr = sprite_addr + 1; int music_addr = sound_addr + 1; int text_addr = music_addr + 1; int signal_addr = text_addr + 1; int camera_addr = signal_addr + 1; int collision_addr = camera_addr + 1; int level_addr = collision_addr + 1; int progress_addr = level_addr + 1; if ((address >= prgm_low) && (address < prgm_high)) { Fblock* block = &this->memory[address]; if (data.type == 0) { // Read if (field.length() == 0) { // Read value. data.string = block->value.string; data.number = block->value.number; data.type = block->value.type; } else { // Read field. if (block->fields.find(field) != block->fields.end()) { data.string = block->fields[field].string; data.number = block->fields[field].number; data.type = block->fields[field].type; } else { // Field not defined. data.string = "null"; data.number = 0; data.type = 2; // String } } } else { // Write if (field.length == 0) { // Write value. block->value.string = data.string; block->value.number = data.number; block->value.type = data.type; } else { // Write field. if (block->fields.find(field) != block->fields.end()) { block->fields[field].string = data.string; block->fields[field].number = data.number; block->fields[field].type = data.type; } else { Fvalue new_data; new_data.string = data.string; new_data.number = data.number; new_data.type = data.type; block.fields[field] = new_data; } } } } }
  6. francoisdiy

    Problem with sleep

    I ride my bike a lot and for some reason (i been ridin' my bike for 10 years) I sleep very well and even dream about projects that I'm currently or will be working on. I only need 6 hours of sleep. I think getting blood pumping through your veins clears you of toxins which would ultimately lead to stress and problems sleeping. Coding should not compromise sleep - if you get up in the middle of the night you are not sound asleep.
  7. francoisdiy

    Coding moods

    I do programming for a living and also as a hobby. I started out in it because I wanted to create my own video games and see program as a way to bring a world to life and to control everything in it. It's kind of like playing God in cyberspace. I like learning about how things get done and why they are done that way - like taking apart a car and just seeing how it works. For me programming as a hobby is very fulfilling but by itself it can suck unless it is tied to a project - like Math it must have a purpose for me otherwise I just think it's a bunch of bologna and BBQ sauce. As for a living I just wing it because I can program and it pays my bills. My true passion is to create the game Bluejay's Quest in 2D and then 3D and then to play the game by myself. I essentially like to program so I can create me own games and play them - if I see a title that doesn't exist I try to create it so I can have something new to play. Programming can take my time so I do program whenever I get a chance but it doesn't not keep me indoors when the weather is nice - I take a break to ride my bike. Sometimes I take a laptop on my bike and stop at a park and program right there. So you could say I am passionate about programming, cycling, and video games. My life rules!
  8. You can take a look at this here but basically I'm converting keyboard, mouse, and gamepad input into signals and then buffering them and removing one signal per frame. I think this is ingenious! void Cio::Rprocess() { sf::Clock clock; // Check for gamepad connection. if (sf::Joystick::isConnected(0)) { if (sf::Joystick::getButtonCount(0) == BUTTON_COUNT) { this->gamepad_connected = true; } } // Try to load gamepad map. std::ifstream config_file("gamepad.cfg"); if (config_file) { for (int button_index = 0; button_index < BUTTON_COUNT; button_index++) { config_file >> this->button_map[button_index]; } } else { this->Rmap_gamepad(); // Do a mapping. } // Do window processing here and block. bool paused = false; while (!this->window->isOpen()) { sf::Event event; while (window->pollEvent(event)) { if (event.type == sf::Event::Closed) { window->close(); } if (event.type == sf::Event::LostFocus) { paused = true; } if (event.type == sf::Event::GainedFocus) { paused = true; } if (!paused) { Fsignal signal; signal.code = 0; signal.x = 0; signal.y = 0; signal.key = 0; signal.button = 0; // Process mouse and keyboard events. this->Rprocess_keys(); this->Rprocess_mouse(); // Process mouse movement. sf::Vector2i coords = sf::Mouse::getPosition(); if (event.type == sf::Event::MouseMoved) { signal.code = SIGNAL_MOVE; signal.x = coords.x; signal.y = coords.y; this->sig_buffer.push_back(signal); } else if (event.type == sf::Event::MouseEntered) { signal.code = SIGNAL_ENTERED; signal.x = coords.x; signal.y = coords.y; this->sig_buffer.push_back(signal); } else if (event.type == sf::Event::MouseLeft) { signal.code = SIGNAL_LEAVE; signal.x = coords.x; signal.y = coords.y; this->sig_buffer.push_back(signal); } // Process the gamepad. if (event.type == sf::Event::JoystickConnected) { this->gamepad_connected = true; } if (event.type == sf::Event::JoystickDisconnected) { this->gamepad_connected = false; } this->Rprocess_gamepad(); // Generate a blanking signal. sf::Time elapsed = clock.getElapsedTime(); if (elapsed.asMilliseconds() >= (1000 / FPS)) { clock.restart(); // Grab a signal and store it in the register. if (this->sig_buffer.size() > 0) { this->signal_reg = this->sig_buffer.front(); this->sig_buffer.erase(this->sig_buffer.begin()); } // Clear back buffer. this->back_buffer->clear(); // Run code here. } } } // Do buffer rendering. this->back_buffer->display(); sf::Texture& texture = this->back_buffer->getTexture(); sf::Sprite buffer_sprite(texture); window->draw(buffer_sprite); // Do window rendering. window->clear(); window->display(); } } void Cio::Rprocess_keys() { Fsignal signal; signal.code = 0; signal.x = 0; signal.y = 0; signal.key = 0; signal.button = 0; if (sf::Keyboard::isKeyPressed(sf::Keyboard::Left)) { signal.code = SIGNAL_LEFT; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Right)) { signal.code = SIGNAL_RIGHT; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Up)) { signal.code = SIGNAL_UP; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Down)) { signal.code = SIGNAL_DOWN; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Z)) { signal.code = SIGNAL_ACTION; signal.button = BUTTON_Y; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::X)) { signal.code = SIGNAL_ACTION; signal.button = BUTTON_B; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::C)) { signal.code = SIGNAL_ACTION; signal.button = BUTTON_A; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::A)) { signal.code = SIGNAL_ACTION; signal.button = BUTTON_X; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Return)) { signal.code = SIGNAL_ACTION; signal.button = BUTTON_START; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::RShift)) { signal.code = SIGNAL_ACTION; signal.button = BUTTON_SELECT; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::C)) { signal.code = SIGNAL_ACTION; signal.button = BUTTON_A; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Num1)) { signal.code = SIGNAL_ACTION; signal.button = BUTTON_L; this->sig_buffer.push_back(signal); } else if (sf::Keyboard::isKeyPressed(sf::Keyboard::Num2)) { signal.code = SIGNAL_ACTION; signal.button = BUTTON_R; this->sig_buffer.push_back(signal); } } void Cio::Rprocess_mouse() { Fsignal signal; signal.code = 0; signal.x = 0; signal.y = 0; signal.key = 0; signal.button = 0; if (sf::Mouse::isButtonPressed(sf::Mouse::Left)) { signal.code = SIGNAL_MOUSE; sf::Vector2i position = sf::Mouse::getPosition(); signal.x = position.x; signal.y = position.y; signal.button = BUTTON_LEFT; this->sig_buffer.push_back(signal); } else if (sf::Mouse::isButtonPressed(sf::Mouse::Right)) { signal.code = SIGNAL_MOUSE; sf::Vector2i position = sf::Mouse::getPosition(); signal.x = position.x; signal.y = position.y; signal.button = BUTTON_RIGHT; this->sig_buffer.push_back(signal); } } void Cio::Rprocess_gamepad() { if (this->gamepad_connected) { Fsignal signal; signal.code = 0; signal.x = 0; signal.y = 0; signal.key = 0; signal.button = 0; // Poll the gamepad to update positions. sf::Joystick::update(); float x_pos = sf::Joystick::getAxisPosition(0, sf::X); float y_pos = sf::Joystick::getAxisPosition(0, sf::Y); if (x_pos == -100.0) { // Values should be standardized. signal.code = SIGNAL_LEFT; this->sig_buffer.push_back(signal); } else if (x_pos == 100.0) { signal.code = SIGNAL_RIGHT; this->sig_buffer.push_back(signal); } if (y_pos == -100.0) { signal.code = SIGNAL_UP; this->sig_buffer.push_back(signal); } else if (y_pos == 100.0) { signal.code = SIGNAL_DOWN; this->sig_buffer.push_back(signal); } // Check for button presses using button map. for (int button_index = 0; button_index < BUTTON_COUNT; button_index++) { int button = this->button_map[button_index]; if (sf::Joystick::isButtonPressed(0, button)) { signal.button = this->button_signal_map[button_index]; // Assign the button signal. this->sig_buffer.push_back(signal); break; } } } }
  9. francoisdiy

    hand over your source code or you get no refund

    I like writing game engine's better. Makes you work hard for what you want and then proud of it later on. Your licenses seem to scare some people, no offends. Let's just leave it at that... ok.
  10. francoisdiy

    hand over your source code or you get no refund

    This is precisely why I don't want to use any commercial game maker or anything like that - even Unity. Once you use them they own your game, code, and assets even if you claim you own your stuff - it's that license crap that's a plug. I think, personally, this is a bunch of bologna and BBQ sauce. I'm doing just as Bagel does - build your own game engine. By the way, is his engine complete? I kind of want to use it for future games.
  11. francoisdiy

    Problem with sleep

    You don't need to age fast. Just eat some greens and you'll keep your body in top shape. Not everything has to go downhill - it can be reversed. It's all food! No kidding!
  12. francoisdiy

    I've made first release! Yeah!

    Very cool. Looks like fun!
  13. francoisdiy

    Hi Everyone!!

    Wanted to know if you know C++.
  14. francoisdiy

    Hi Everyone!!

    Can you program well?
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!