void StartScreen() {
	int x=3,y=2;
	int a=0;
	gotoxy(x , y );printf("■■■  ■      ■■■  ■  ■  ■■  \n");//1
	Sleep(100);gotoxy(x,y+1 );printf("■      ■      ■  ■  ■  ■  ■  ■   made\n");//2
	Sleep(100);gotoxy(x,y+2 );printf("■      ■      ■  ■  ■  ■  ■  ■    by\n");//3
	Sleep(100);gotoxy(x,y+3 );printf("■      ■      ■  ■  ■  ■  ■  ■  yoonki\n");//4
	Sleep(100);gotoxy(x,y+4 );printf("■■■  ■■■  ■■■  ■■■  ■■  \n");//5
	Sleep(100);
	gotoxy(x,y+5 );printf("\n");//6
	gotoxy(x,y+6 );printf("■■■    ■      ■    ■  ■    ■      ■■\n");//7
	Sleep(100);gotoxy(x,y+7 );printf("  ■    ■  ■  ■■■  ■■            ■    \n");//8
	Sleep(100);gotoxy(x,y+8 );printf("  ■    ■■■    ■    ■        ■      ■  \n");//9
	Sleep(100);gotoxy(x,y+9 );printf("  ■    ■        ■    ■        ■        ■\n");//10
	Sleep(100);gotoxy(x,y+10);printf("  ■      ■■    ■    ■        ■    ■■  \n");//11
	while(1){
		if(kbhit())break;
		Sleep(800);
		gotoxy(x+13,y+12);printf("PRESS ANY KEY!");
		if(kbhit())break;
		Sleep(800);
		gotoxy(x+13,y+12);printf("              ");
	}
	CLEAR;
	GameScreen();
}
Beispiel #2
0
void Game::run()
{
    sf::Clock clock;
    GameScreen gs = GameScreen(this);
    gs.initNewGame();
    _currentScreen = &gs; 
    bool quit = false;

    while(_window->isOpen())
    {
        sf::Time delta = clock.restart();
        _mouse->update(delta);
        _keyInput->update(delta);
        sf::Event event;
        while(_window->pollEvent(event))
        {
            if(event.type == sf::Event::Closed)
            {
                _window->close();
                quit = true;
            }
            else if(event.type == sf::Event::MouseWheelMoved)
            {
                _mouse->_wheelDelta = event.mouseWheel.delta;
            }
        }
        if(!quit)
        {
            update(delta);
            draw(delta);
        }
    }
    _currentScreen = NULL;
}
Beispiel #3
0
int MainMenu::open(sf::RenderWindow* window) {
    int anim = 0;
    bool load = false;
    sf::RectangleShape fadeOverlay = sf::RectangleShape(sf::Vector2f(800,500));
    fadeOverlay.setFillColor(sf::Color(0,0,0,0));
    window->setView(window->getDefaultView());
    while (window->isOpen()) {
        sf::Event event;
        while(window->pollEvent(event)) {
            if(event.type == sf::Event::Closed) window->close();
            if(event.type == sf::Event::KeyPressed) {
                if (event.key.code == sf::Keyboard::Escape) window->close();
            }
            if(event.type == sf::Event::MouseButtonPressed) {
                if(playButton.pointOnBox(event.mouseButton.x, event.mouseButton.y)) anim = 121;
                if(loadButton.pointOnBox(event.mouseButton.x, event.mouseButton.y)) load = true, anim = 121;
            }
            if(event.type == sf::Event::Resized) window->setView(sf::View(sf::Vector2f(window->getSize().x/2,window->getSize().y/2), sf::Vector2f(window->getSize())));
        }

        if(anim < 120) title.setPosition(5,pow((float)(anim - 120),3)/-1728), anim++;
        if(anim == 120) title.setPosition(5,0);
        if(anim >= 121) fadeOverlay.setFillColor(sf::Color(0,0,0,255*(anim-120)/60)), anim++;
        if(anim == 180) {
            GameScreen(load).open(window);
            anim = 120;
        }

        window->clear(sf::Color(0,0,0,255));
        window->draw(playButton);
        window->draw(loadButton);
        window->draw(title);
        window->draw(fadeOverlay);
        window->display();
    }
    return 0;
}
Beispiel #4
0
void MainWindow::Private::captureCatalog()
{
    qDebug() << "captureCatalog";

    //設定確認
    checkSavePath();

    QRect captureRect = CATALOG_RECT_CAPTURE;
    QList<QRect> shipRectList;
    {
        shipRectList << CATALOG_RECT_SHIP1
                     << CATALOG_RECT_SHIP2
                     << CATALOG_RECT_SHIP3;
    }
    QList<QRect> pageRectList;
    {
        pageRectList << CATALOG_RECT_PAGE1
                     << CATALOG_RECT_PAGE2
                     << CATALOG_RECT_PAGE3
                     << CATALOG_RECT_PAGE4
                     << CATALOG_RECT_PAGE5;
    }

    QImage resultImg(captureRect.width() * shipRectList.size()
                     , captureRect.height() * pageRectList.size()
                     ,QImage::Format_ARGB32);
    QPainter painter(&resultImg);

    QPoint currentPos = ui.webView->page()->mainFrame()->scrollPosition();
    QRect geometry = ui.webView->getGameRect();

    if (GameScreen(ui.webView->capture()).screenType() != GameScreen::CatalogScreen)
    {
        ui.webView->page()->mainFrame()->setScrollPosition(currentPos);
        ui.statusBar->showMessage(tr("not in catalog"), STATUS_BAR_MSG_TIME);
        return;
    }

    //開始確認
    QMessageBox::StandardButton res = QMessageBox::warning(q
                                                           , tr("Kan Memo")
                                                           , tr("Capture the catalog.\nPlease wait while a cup of coffee.")
                                                           , QMessageBox::Yes | QMessageBox::Cancel);
    if(res == QMessageBox::Cancel)
        return;

    //メニュー無効
    ui.menuBar->setEnabled(false);
    ui.toolBar->setEnabled(false);

    ui.webView->setAttribute(Qt::WA_TransparentForMouseEvents, true);
    ui.statusBar->showMessage(tr("making catalog"), -1);
    ui.progressBar->show();
    ui.progressBar->setValue(0);
    for (int type = 0; type < shipRectList.size(); type++)
    {
        int tx = geometry.x()
                + (shipRectList.value(type).x() + qrand() % shipRectList.value(type).width());
        int ty = geometry.y()
                + (shipRectList.value(type).y() + qrand() % shipRectList.value(type).height());
        clickGame(QPoint(tx, ty));

        for (int page = 0; page < pageRectList.size(); page++)
        {
            int px = geometry.x()
                    + (pageRectList.value(page).x() + qrand() % pageRectList.value(page).width());
            int py = geometry.y()
                    + (pageRectList.value(page).y() + qrand() % pageRectList.value(page).height());
            clickGame(QPoint(px, py));

            QImage details = ui.webView->capture().copy(captureRect);
            painter.drawImage(captureRect.width() * type
                              , captureRect.height() * page
                              , details);

            ui.progressBar->setValue((pageRectList.size() * type + (page + 1)) * 100
                                     / (pageRectList.size() * shipRectList.size()) );
        }
    }
    ui.progressBar->hide();
    ui.webView->page()->mainFrame()->setScrollPosition(currentPos);
    ui.webView->setAttribute(Qt::WA_TransparentForMouseEvents, false);
    ui.statusBar->showMessage("", -1);

    char format[] = "jpg";
    QString path = makeFileName(QString(format));
    qDebug() << "path:" << path;

    //保存する
    ui.statusBar->showMessage(tr("saving to %1...").arg(path), STATUS_BAR_MSG_TIME);
    if(resultImg.save(path, format))
    {
        //つぶやくダイアログ
        openTweetDialog(path);
    }else{
        ui.statusBar->showMessage(tr("failed save image"), STATUS_BAR_MSG_TIME);
    }

    //メニュー復活
    ui.menuBar->setEnabled(true);
    ui.toolBar->setEnabled(true);
}