Giter Club home page Giter Club logo

friceengine's People

Contributors

akimotoakari avatar daniel4git avatar ice1000 avatar lfkdsk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

friceengine's Issues

Customizing collision box

Instead of implementing pixel-level collision detection (#9 ), I personally recommand to provide a standalone collision box.

Refactor demos

If I use the new way of collision detection, I'll have to refactor the demos.

Old API: addCollider(obj, callBack)
New API: setCollider(callBack)

Refactor "FDialog"

This should be a function of Game or GameFx, not standalone.
Old API will be deleted. Please mention.

运行出错了

不懂Kotlin,跑test的时候出现了2个问题:一个是AudioManager.kt的13行和16行编译出错,提示说要在async后加(),加上后编译OK,是Kotlin版本问题???二是运行后抛出空指针异常,原因是Game.kt的404行中的panel为空,看panel是在172行初始化的,debug发现压根就没执行这句话,啥情况???

Font tmp

The font objects are not reused. It's a kind of waste.

Stupid mistake

Stupid mistake in AttachedObjects.

fun addObject(vararg objects: T) = objects.forEach { objs.remove(it) }
fun removeObject(vararg objects: T) = objects.forEach { objs.remove(it) }

Rendering bug

package com.github.kircute_ect.ectrpg.gui;

import com.github.kircute_ect.ectrpg.resources.Resources;
import org.frice.game.Game;
import org.frice.game.obj.sub.ImageObject;
import org.frice.game.utils.time.FTimer;

import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;

public final class Gameframe extends Game {
    private FTimer timer;
    @Override
    public void onInit() {
        super.onInit();
        Resources.getAllConfigs().readConfig();
        Resources.replenishConfig();
        switch (Resources.getAllConfigs().getConfig("GameOptions", "screen")) {
            case 0:
                this.setSize(new Dimension(608, 480));break;
            case 1:
                this.setSize(new Dimension(928, 736));break;
            case 2:
                this.setSize(new Dimension(1248, 928));break;
            case 3:
                //TODO full screen
                break;
            default:
                this.setSize(new Dimension(608, 480));
        }
    }
    @Override
    public void onExit() {
        super.onExit();
    }
    @Override
    public void onRefresh() {
        super.onRefresh();
        if(timer.ended()) {
            if(Resources.getPlayer().getDoor() != 0) {
                if(Resources.getPlayer().getDoor() < 0) {
                    if(Resources.getPlayer().getDoor() == -20) {
                        Resources.getPlayer().inedDoor();
                    } else {
                        Resources.getPlayer().nextDoor();
                    }
                } else if(Resources.getPlayer().getDoor() > 0) {
                    Resources.getPlayer().nextDoor();
                }
            }
            if(Resources.getPlayer().getDoor() == -20) {
                Resources.getPlayer().teleported();
                Resources.getPlayer().setTeleport(null);
            }
            //TODO Game Refresh
            int startpoint[] = {0,0};
            float upBorderDistance = Resources.getPlayer().getLocation()[1];
            float downBorderDistance = Resources.getPlayerMap().getMapHeight() - Resources.getPlayer().getLocation()[1];
            float leftBorderDistance = Resources.getPlayer().getLocation()[2];
            float rightBorderDistance = Resources.getPlayerMap().getMapWidth() - Resources.getPlayer().getLocation()[2];
            int cameraMovingMinHeight = this.getHeight() / 32;
            int cameraMovingMinWidth = this.getWidth() / 32;
            boolean dontMovingUp = ( upBorderDistance <= cameraMovingMinHeight );
            boolean dontMovingDown = ( downBorderDistance <= cameraMovingMinHeight );
            boolean dontMovingLeft = ( leftBorderDistance <= cameraMovingMinWidth );
            boolean dontMovingRight = ( rightBorderDistance <= cameraMovingMinWidth );
            boolean lockUpDown = ( dontMovingUp && dontMovingDown );
            boolean lockLeftRight = ( dontMovingLeft && dontMovingRight );
            boolean miniMap = ( lockUpDown && lockLeftRight );
            if(miniMap) {
                startpoint[0] = (this.getHeight() - Resources.getPlayerMap().getMapHeight() * 32) / 2;
                startpoint[1] = (this.getWidth() - Resources.getPlayerMap().getMapWidth() * 32) / 2;
                for(int width = 0; width < Resources.getPlayerMap().getMapWidth(); width++) {
                    for(int height = 0; height < Resources.getPlayerMap().getMapHeight(); height++) {
                        this.addObject(new ImageObject(Resources.getPlayerMap().getMapView()[height][width],(double)width * 32, (double)height * 32));
                    }
                }
            }
        }
    }

More handy API for collision box

Should be like this:

  • obj.useCollisionOffset(top, bottom, left, right)
  • obj.useCollisionOffset(topBottom, leftRight)
  • obj.useCollisionOffset(allDirection)

Do you like what you see? :trollface:

New drawing APIs

There're currently only drawXxx APIs.
There can be some APIs like strokeXxx.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.