abdulmunafali8 Goto Github PK
Type: User
Type: User
:loudspeaker: React coding challenge based on Apollo, GraphQL, Prisma and Node.js
The open-source repo for docs.github.com
## welcome to GitHub page
Just another respository
} public class GameView extends View{ private Paint myPaint; private int speed=1; private int time = 0; private int score = 0; private int myCarPosition = 0; private ArrayList<HashMap<String, Object>> otherCars = new ArrayList<>(); int viewWidth = 0; int viewHeight = 0; public GameView(Context context){ super(context); myPaint = new Paint(); } @Override protected void onDraw(Canvas canvas) { viewWidth = this.getMeasuredWidth(); viewHeight = this.getMeasuredHeight(); if (time%700 < 10 + speed){ HashMap<String, Object> map = new HashMap<>(); map.put("lane", getRandom(0,2)); map.put("startTime", time); otherCars.add(map); } time = time + 10 + speed; int carWidth = viewWidth/5; int carHeight = carWidth+10; myPaint.setStyle(android.graphics.Paint.Style.FILL); android.graphics.drawable.Drawable d = getResources().getDrawable(R.drawable.car_blue, null); d.setBounds((myCarPosition*viewWidth/3) + viewWidth/15 + 25, viewHeight - 2 -carHeight, (myCarPosition*viewWidth/3) + (viewWidth/15) + carWidth-25, viewHeight-2); d.draw(canvas); myPaint.setColor(Color.GREEN); for (int i = 0; i<otherCars.size(); i++){ int carX = ((int)otherCars.get(i).get("lane")*viewWidth/3) + viewWidth/15; int carY = time - (int)otherCars.get(i).get("startTime"); android.graphics.drawable.Drawable d2 = getResources().getDrawable(R.drawable.car_yellow, null); d2.setBounds(carX+25, carY-carHeight, carX + carWidth-25, carY); d2.draw(canvas); if ((int)otherCars.get(i).get("lane") == myCarPosition){ if (carY > viewHeight - 2 - carHeight && carY < viewHeight - 2){ sp.edit().putString("hs", String.valueOf((int)highscore)).commit(); sp.edit().putString("score", String.valueOf(score)).commit(); finish(); }} if (carY > viewHeight + carHeight){ otherCars.remove(i); score++; speed = 1 + Math.abs(score/8); if (score > highscore){ highscore = score; } } } myPaint.setColor(Color.WHITE); myPaint.setTextSize(40); canvas.drawText("Score: " + String.valueOf(score), 80f, 80f, myPaint); canvas.drawText("Speed: " + String.valueOf(speed), 380f, 80f, myPaint); invalidate(); } @Override public boolean onTouchEvent(MotionEvent event) { switch(event.getAction()) { case MotionEvent.ACTION_DOWN: float x1 = event.getX(); if ( x1<viewWidth/2){ if (myCarPosition>0){ myCarPosition--; } } if ( x1>viewWidth/2){ if (myCarPosition<2){ myCarPosition++; } } invalidate(); break; case MotionEvent.ACTION_UP: break; } return true; }
The Mobile Checker is a tool for Web developers who want to make their Web page or Web app work better on mobile devices.
ObjectBox C library
A Web Application to Visualize the Org-Roam Database
<?xml version="1.0" encoding="UTF-8"?> <module external.linked.project.id="aSerendipity" external.linked.project.path="$MODULE_DIR$" external.root.project.path="$MODULE_DIR$" external.system.id="GRADLE" external.system.module.group="" external.system.module.version="unspecified" type="JAVA_MODULE" version="4"> <component name="FacetManager"> <facet type="java-gradle" name="Java-Gradle"> <configuration> <option name="BUILD_FOLDER_PATH" value="$MODULE_DIR$/build" /> <option name="BUILDABLE" value="false" /> </configuration> </facet> </component> <component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7" inherit-compiler-output="true"> <exclude-output /> <content url="file://$MODULE_DIR$"> <excludeFolder url="file://$MODULE_DIR$/.gradle" /> </content> <orderEntry type="jdk" jdkName="Android API 23 Platform" jdkType="Android SDK" /> <orderEntry type="sourceFolder" forTests="false" /> </component> </module
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.