1 / 14

PERINTAH-PERINTAH DASAR GREENFOOT II

PERINTAH-PERINTAH DASAR GREENFOOT II. Drs. Sugeng Rianto, M. Sc. Ubaidillah, S. Si. Overview. Greenfoot Primitive Objects String  Scorring Image Manipulation Intersecting (Tumbukan/Collision) Penambahan efek suara Exporting Scenario. New GreenfootImage.

Download Presentation

PERINTAH-PERINTAH DASAR GREENFOOT II

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PERINTAH-PERINTAH DASAR GREENFOOT II Drs. Sugeng Rianto, M. Sc. Ubaidillah, S. Si

  2. Overview • Greenfoot Primitive Objects • String  Scorring • Image Manipulation • Intersecting (Tumbukan/Collision) • Penambahan efek suara • Exporting Scenario

  3. New GreenfootImage • Membuat Gambar Greenfoot kosong dengan lebar dan tinggi tertentu • GreenfootImage image=new GreenfootImage(width,hight) • Gambar Greenfoot dengan mengimport dari file png • GreenfootImage image=new GreenfootImage(“file.png”) • Membuat Gambar Greenfoot yang baru sama persis dengan Gambar Greenfoot yang telah diload/inisialisasikan sebelumnya • GreenfootImage image=new GreenfootImage(buffer)

  4. Greenfoot Primitive Objects • Set Color import java.awt.Color; … image.setColor(Color.BLACK); • draw Object • image.drawLine(posx,posy,widthx, widthy); • image.drawRect(posx,posy,width,height); • image.drawOval(posx,posy, widthx, widthy); • image.fillRect(posx,posy,width,height); • image. fillOval(posx,posy, widthx, widthy);

  5. drawLine • Laser

  6. drawRect & fillRect • Membuat Efek Pecahan Kaca Digunakan untuk Menggenerate kotak (drawRect) dan kotak yang terisi (fillRect), dengan ukuran Random lebar antara 1-10 dan juga tinggi antara 1-10

  7. drawOval & fillOval • Particle System • untuk membuat bola agar terlihat lebih berat ro=jari-jari lingkaran

  8. Add String • Digunakan untuk menambahkan keterangan atau tulisan (Contoh : Scoring) String atau tulisan dianggap juga sebagai gambar

  9. Image Manipulation • Masking Effect

  10. Image Manipulation • Masking Effect Teknik Masking

  11. Intersecting • Intersecting == Tumbukan/Collisions Detection • Mendeteksi Object lain (Actor Vs Actor) • Macam Intersect: • getObjectsAtOffset(Offsetx,Offsety, Actor.class); • getNeighbours(NumNeighbours, false, Actor.class); • getObjectsInRange(range, Actor.class); • getOneIntersectingObject(Actor.class); • getIntersectingObjects(Actor.class);

  12. Penambahan efek suara

  13. Exporting Scenario

  14. Pustaka • Kölling, Michael and Martin Pain. 2010. The Greenfoot Programmers' Manual. University of Kent.

More Related