-
Notifications
You must be signed in to change notification settings - Fork 1
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
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,2 @@ | |||
Manifest-Version: 1.0 |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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.
******************************************************************************/
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; |
There was a problem hiding this comment.
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() { |
There was a problem hiding this comment.
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() { | ||
|
There was a problem hiding this comment.
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.
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary empty lines.
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)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix variable ordering.
// public float frameDuration = 0.025f; | ||
|
||
// Texture spriteTexture = Mdx.graphics.newTexture(Mdx.files.internal(TREX_SPRITE_SHEET_LOCATION)); | ||
// SpriteSheet trexSpriteSheet = new SpriteSheet(spriteTexture, 512, 512); |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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) { |
There was a problem hiding this comment.
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?
No description provided.