git repos / blockattack-game

blame: source/code/HelpHowtoState.cpp

normal view · raw

d8fe60bd sago007 2018-04-02 16:15 1
/*
d8fe60bd sago007 2018-04-02 16:15 2
===========================================================================
d8fe60bd sago007 2018-04-02 16:15 3
blockattack - Block Attack - Rise of the Blocks
d8fe60bd sago007 2018-04-02 16:15 4
Copyright (C) 2005-2018 Poul Sander
d8fe60bd sago007 2018-04-02 16:15 5
d8fe60bd sago007 2018-04-02 16:15 6
This program is free software: you can redistribute it and/or modify
d8fe60bd sago007 2018-04-02 16:15 7
it under the terms of the GNU General Public License as published by
d8fe60bd sago007 2018-04-02 16:15 8
the Free Software Foundation, either version 2 of the License, or
d8fe60bd sago007 2018-04-02 16:15 9
(at your option) any later version.
d8fe60bd sago007 2018-04-02 16:15 10
d8fe60bd sago007 2018-04-02 16:15 11
This program is distributed in the hope that it will be useful,
d8fe60bd sago007 2018-04-02 16:15 12
but WITHOUT ANY WARRANTY; without even the implied warranty of
d8fe60bd sago007 2018-04-02 16:15 13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
d8fe60bd sago007 2018-04-02 16:15 14
GNU General Public License for more details.
d8fe60bd sago007 2018-04-02 16:15 15
d8fe60bd sago007 2018-04-02 16:15 16
You should have received a copy of the GNU General Public License
d8fe60bd sago007 2018-04-02 16:15 17
along with this program.  If not, see http://www.gnu.org/licenses/
d8fe60bd sago007 2018-04-02 16:15 18
d8fe60bd sago007 2018-04-02 16:15 19
Source information and contacts persons can be found at
d8fe60bd sago007 2018-04-02 16:15 20
https://blockattack.net
d8fe60bd sago007 2018-04-02 16:15 21
===========================================================================
d8fe60bd sago007 2018-04-02 16:15 22
*/
d8fe60bd sago007 2018-04-02 16:15 23
d8fe60bd sago007 2018-04-02 16:15 24
#include "HelpHowtoState.hpp"
d8fe60bd sago007 2018-04-02 16:15 25
#include "global.hpp"
d8fe60bd sago007 2018-04-02 16:15 26
#include "common.h"
d8fe60bd sago007 2018-04-02 16:15 27
#include "MenuSystem.h"
d8fe60bd sago007 2018-04-02 16:15 28
d8fe60bd sago007 2018-04-02 16:15 29
HelpHowtoState::HelpHowtoState() {
d8fe60bd sago007 2018-04-02 16:15 30
	box.SetHolder(&globalData.spriteHolder->GetDataHolder());
d8fe60bd sago007 2018-04-02 16:15 31
	box.SetFontSize(30);
d8fe60bd sago007 2018-04-02 16:15 32
	box.SetOutline(1, {128,128,128,255});
d8fe60bd sago007 2018-04-02 16:15 33
	box.SetText(_("The basic purpose of the game is to match 3 or more blocks of identical color to make them explode.\n"
d8fe60bd sago007 2018-04-02 16:15 34
	"You can only move blocks vertically."
d8fe60bd sago007 2018-04-02 16:15 35
	"The blocks are constantly raising from the bottom of the screen. Once they reach the top the game will start counting down to your"
d8fe60bd sago007 2018-04-02 16:15 36
	" imminent defeat."));
d8fe60bd sago007 2018-04-02 16:15 37
}
d8fe60bd sago007 2018-04-02 16:15 38
d8fe60bd sago007 2018-04-02 16:15 39
HelpHowtoState::~HelpHowtoState() {
d8fe60bd sago007 2018-04-02 16:15 40
}
d8fe60bd sago007 2018-04-02 16:15 41
d8fe60bd sago007 2018-04-02 16:15 42
bool HelpHowtoState::IsActive() {
d8fe60bd sago007 2018-04-02 16:15 43
	return isActive;
d8fe60bd sago007 2018-04-02 16:15 44
}
d8fe60bd sago007 2018-04-02 16:15 45
d8fe60bd sago007 2018-04-02 16:15 46
void HelpHowtoState::ProcessInput(const SDL_Event& event, bool& processed) {
d8fe60bd sago007 2018-04-02 16:15 47
d8fe60bd sago007 2018-04-02 16:15 48
	UpdateMouseCoordinates(event, globalData.mousex, globalData.mousey);
d8fe60bd sago007 2018-04-02 16:15 49
d8fe60bd sago007 2018-04-02 16:15 50
	if (isConfirmEvent(event) || isEscapeEvent(event)) {
d8fe60bd sago007 2018-04-02 16:15 51
		isActive = false;
d8fe60bd sago007 2018-04-02 16:15 52
		processed = true;
d8fe60bd sago007 2018-04-02 16:15 53
	}
d8fe60bd sago007 2018-04-02 16:15 54
}
d8fe60bd sago007 2018-04-02 16:15 55
d8fe60bd sago007 2018-04-02 16:15 56
void HelpHowtoState::Draw(SDL_Renderer* target) {
d8fe60bd sago007 2018-04-02 16:15 57
	DrawBackground(target);
d8fe60bd sago007 2018-04-02 16:15 58
	box.SetMaxWidth(1000);
d8fe60bd sago007 2018-04-02 16:15 59
	box.Draw(target, 10,10);
d8fe60bd sago007 2018-04-02 16:15 60
}
d8fe60bd sago007 2018-04-02 16:15 61
d8fe60bd sago007 2018-04-02 16:15 62
void HelpHowtoState::Update() {
d8fe60bd sago007 2018-04-02 16:15 63
	
d8fe60bd sago007 2018-04-02 16:15 64
}