Changed license to 2-clause BSD. Removed boilerplate from states.

This commit is contained in:
2014-10-13 09:45:16 -04:30
parent 5c3b2fc684
commit 48918cdc81
15 changed files with 192 additions and 333 deletions

View File

@@ -1,17 +1,17 @@
/*
* Copyright (C) 2014 Miguel Angel Astor Romero
* Copyright (c) 2014, Miguel Angel Astor Romero
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* http://www.apache.org/licenses/LICENSE-2.0
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Read the LICENSE file for more details.
*/
package com.gamejolt.mikykr5.poukemon;

View File

@@ -1,17 +1,17 @@
/*
* Copyright (C) 2014 Miguel Angel Astor Romero
* Copyright (c) 2014, Miguel Angel Astor Romero
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* http://www.apache.org/licenses/LICENSE-2.0
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Read the LICENSE file for more details.
*/
package com.gamejolt.mikykr5.poukemon;

View File

@@ -1,17 +1,17 @@
/*
* Copyright (C) 2014 Miguel Angel Astor Romero
* Copyright (c) 2014, Miguel Angel Astor Romero
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* http://www.apache.org/licenses/LICENSE-2.0
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Read the LICENSE file for more details.
*/
package com.gamejolt.mikykr5.poukemon.effects;

View File

@@ -1,17 +1,17 @@
/*
* Copyright (C) 2014 Miguel Angel Astor Romero
* Copyright (c) 2014, Miguel Angel Astor Romero
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* http://www.apache.org/licenses/LICENSE-2.0
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Read the LICENSE file for more details.
*/
package com.gamejolt.mikykr5.poukemon.interfaces;

View File

@@ -1,17 +1,17 @@
/*
* Copyright (C) 2014 Miguel Angel Astor Romero
* Copyright (c) 2014, Miguel Angel Astor Romero
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* http://www.apache.org/licenses/LICENSE-2.0
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Read the LICENSE file for more details.
*/
package com.gamejolt.mikykr5.poukemon.states;
@@ -24,13 +24,19 @@ import com.badlogic.gdx.math.Vector3;
import com.gamejolt.mikykr5.poukemon.GameCore;
public abstract class BaseState implements Screen, InputProcessor{
private static final String CLASS_NAME = BaseState.class.getSimpleName();
protected GameCore core;
protected boolean stateEnabled;
protected OrthographicCamera pixelPerfectCamera;
protected Vector3 win2world;
protected Vector2 touchPointWorldCoords;
public BaseState(){
public BaseState(final GameCore core) throws IllegalArgumentException{
if(core == null)
throw new IllegalArgumentException(CLASS_NAME + ": Core is null.");
this.core = core;
this.pixelPerfectCamera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
win2world = new Vector3(0.0f, 0.0f, 0.0f);
touchPointWorldCoords = new Vector2();

View File

@@ -0,0 +1,36 @@
/*
* Copyright (c) 2014, Miguel Angel Astor Romero
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Read the LICENSE file for more details.
*/
package com.gamejolt.mikykr5.poukemon.states;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.GL20;
import com.gamejolt.mikykr5.poukemon.GameCore;
public class InGameState extends BaseState {
public InGameState(final GameCore core) throws IllegalArgumentException {
super(core);
}
@Override
public void render(float delta) {
Gdx.gl.glClearColor(0, 0, 0, 1);
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
}
@Override
public void dispose() {
}
}

View File

@@ -1,17 +1,17 @@
/*
* Copyright (C) 2014 Miguel Angel Astor Romero
* Copyright (c) 2014, Miguel Angel Astor Romero
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* http://www.apache.org/licenses/LICENSE-2.0
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Read the LICENSE file for more details.
*/
package com.gamejolt.mikykr5.poukemon.states;
@@ -27,8 +27,6 @@ import com.gamejolt.mikykr5.poukemon.utils.AsyncAssetLoader;
import com.gamejolt.mikykr5.poukemon.utils.CachedFontManager;
public class LoadingState extends BaseState{
private static final String CLASS_NAME = MainMenuState.class.getSimpleName();
// Helper fields.
private AsyncAssetLoader loader;
private CachedFontManager fontManager;
@@ -40,16 +38,11 @@ public class LoadingState extends BaseState{
private ScrollingBackground scrollingBckg;
public LoadingState(final GameCore core) throws IllegalArgumentException{
super();
super(core);
loader = AsyncAssetLoader.getInstance();
fontManager = CachedFontManager.getInstance();
if(core == null)
throw new IllegalArgumentException(CLASS_NAME + ": Core is null.");
this.core = core;
// Create the start button font.
font = fontManager.loadFont("data/fonts/Big_Bottom_Cartoon.ttf", CachedFontManager.BASE_FONT_SIZE * 3);

View File

@@ -1,17 +1,17 @@
/*
* Copyright (C) 2014 Miguel Angel Astor Romero
* Copyright (c) 2014, Miguel Angel Astor Romero
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* http://www.apache.org/licenses/LICENSE-2.0
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Read the LICENSE file for more details.
*/
package com.gamejolt.mikykr5.poukemon.states;
@@ -22,17 +22,12 @@ import com.gamejolt.mikykr5.poukemon.GameCore;
import com.gamejolt.mikykr5.poukemon.GameCore.game_states_t;
public class LogoScreenState extends BaseState{
private static final String CLASS_NAME = LogoScreenState.class.getSimpleName();
private Texture logo;
private long then;
public LogoScreenState(final GameCore core){
if(core == null)
throw new IllegalArgumentException(CLASS_NAME + ": Core is null.");
this.core = core;
public LogoScreenState(final GameCore core) throws IllegalArgumentException{
super(core);
then = System.currentTimeMillis();
logo = new Texture(Gdx.files.internal("data/gfx/textures/monkey.png"));
}

View File

@@ -1,17 +1,17 @@
/*
* Copyright (C) 2014 Miguel Angel Astor Romero
* Copyright (c) 2014, Miguel Angel Astor Romero
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* http://www.apache.org/licenses/LICENSE-2.0
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Read the LICENSE file for more details.
*/
package com.gamejolt.mikykr5.poukemon.states;
@@ -35,8 +35,6 @@ import com.gamejolt.mikykr5.poukemon.utils.AsyncAssetLoader;
import com.gamejolt.mikykr5.poukemon.utils.CachedFontManager;
public class MainMenuState extends BaseState implements AssetsLoadedListener{
private static final String CLASS_NAME = MainMenuState.class.getSimpleName();
// Helper fields.
private AsyncAssetLoader loader;
private CachedFontManager fontManager;
@@ -63,12 +61,8 @@ public class MainMenuState extends BaseState implements AssetsLoadedListener{
private int quitButtonTouchPointer;
public MainMenuState(final GameCore core) throws IllegalArgumentException{
super();
super(core);
if(core == null)
throw new IllegalArgumentException(CLASS_NAME + ": Core is null.");
this.core = core;
loader = AsyncAssetLoader.getInstance();
fontManager = CachedFontManager.getInstance();
assetsLoaded = false;

View File

@@ -1,17 +1,17 @@
/*
* Copyright (C) 2014 Miguel Angel Astor Romero
* Copyright (c) 2014, Miguel Angel Astor Romero
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* http://www.apache.org/licenses/LICENSE-2.0
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Read the LICENSE file for more details.
*/
package com.gamejolt.mikykr5.poukemon.utils;

View File

@@ -1,17 +1,17 @@
/*
* Copyright (C) 2014 Miguel Angel Astor Romero
* Copyright (c) 2014, Miguel Angel Astor Romero
* All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* http://www.apache.org/licenses/LICENSE-2.0
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* Read the LICENSE file for more details.
*/
package com.gamejolt.mikykr5.poukemon.utils;