Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trex-sample-runner #1

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

trex-sample-runner #1

wants to merge 1 commit into from

Conversation

EiderNieto
Copy link

No description provided.

@@ -0,0 +1,2 @@
Manifest-Version: 1.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add build/ to the .gitignore file

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll also need to delete the build folder, make a commit, then squash the commit to remove the files for Github. It's generally best practice not to commit build files into the repo so that other developers don't get your files.

@@ -0,0 +1,144 @@
package com.mystudio.ChromeTrexGame;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add the license header to all java files? See below:

/*******************************************************************************
 * Copyright 2020 Viridian Software Limited
 *
 * 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
 *
 *   http://www.apache.org/licenses/LICENSE-2.0
 *
 * 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.
 ******************************************************************************/

Comment on lines +33 to +46
InputHandler inputHandler;
Viewport fitViewport;
Trex trexTexture;
TrexData trexData;
Trex trex;
Obstacle obstacle;
Obstacle[] obstacles;
Obstacle obstacleTexture;
Sounds gameSounds;
//colisiones de el techo y el suelo del juego
CollisionBox[] colliderBottom, obstacleCollider;
Texture background;
//Texture ground;
UI ui;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless these fields need to be accessed by other classes in the same package, change them to private.


public class InputHandler {

boolean spacePressed() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set to public

public class InputHandler {

boolean spacePressed() {

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also remove unnecessary empty lines.

Comment on lines +26 to +27


Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary empty lines.

Comment on lines +18 to +32
public static float trex_x = 200;

public static float trexY = 0;

private float trexTextureHeight, trexTextureWidht;


private float trexAccel = 0.0f;


public static final CollisionPoint trexPoint = new CollisionPoint();
public static final String TREX_LOCATION = "Trex/trex1.png";
private Physics physics;

Texture obstacleTexture = Mdx.graphics.newTexture(Mdx.files.internal(TREX_LOCATION));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix variable ordering.

Comment on lines +34 to +37
// public float frameDuration = 0.025f;

// Texture spriteTexture = Mdx.graphics.newTexture(Mdx.files.internal(TREX_SPRITE_SHEET_LOCATION));
// SpriteSheet trexSpriteSheet = new SpriteSheet(spriteTexture, 512, 512);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Avoid committing commented out code.

}


void update(boolean isJumping, float delta) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set to public

}
}

CollisionBox generateCollisionAt(float xPos, float yPos) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this method needed since it is commented out on line 46?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants