精华内容
下载资源
问答
  • 首先感谢我们组的两位大佬,认真负责又很有耐心地指导我们,跟着他们学到了不少东西。 先设计好初稿,然后再分析实现步骤,比如列出数学物理公式,最后就是编码实现阶段了。下面是我的代码: BulletCenterDance: ...
    首先感谢我们组的两位大佬,认真负责又很有耐心地指导我们,跟着他们学到了不少东西。

    先设计好初稿,然后再分析实现步骤,比如列出数学物理公式,最后就是编码实现阶段了。下面是我的代码:

    BulletCenterDance:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class BulletCenterDance : BulletTypeB {
    
        public Vector2 Valocity;
        
        // Update is called once per frame
        void Update () {
            transform.Translate(Valocity * Time.deltaTime);
        }
    }
    

    RevolveCircle:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class RevolveCircle : SpellCard {
    
        public RevolveCircle() : base(new Circle(), new Vector2(-1.5f, 2.4f), 78f, 15000, "想起「旋转圆舞」 ")
        {
        }
    }
    
    class Circle : State<Boss>{
        float time = 2f;
        float timeC = 4f;
        float t = -4f;
        GameObject Revolve;
        public override void Enter(Boss owner)
        {
            Revolve  = ((Satori)owner).RevolveCircleResources.GetComponent<RevolveCircleResource>().RevolveCircle;
            owner.transform.position = new Vector3(-1.53f, 0, 0);
        }
        public override void Execute(Boss owner)
        {
            timeC -= Time.deltaTime;
            time -= Time.deltaTime;
            t += Time.deltaTime;
            if (time < 0) {
                time += 0.1f;
                Vector2 StartLo;
                if (GameManager.player != null) {
                    StartLo = GameManager.player.transform.position - owner.transform.position;
                } else {
                    StartLo = new Vector2 (0, 1);
                }
                StartLo.Normalize ();
                for (int i = -1; i <= 1; i++) {
                    float routeAngle = 30 * Mathf.Deg2Rad * i;
                    Vector2 valocity = new Vector2(StartLo.x*Mathf.Cos(routeAngle)-StartLo.y*Mathf.Sin(routeAngle),StartLo.x*Mathf.Sin(routeAngle)+StartLo.y*Mathf.Cos(routeAngle));
                    valocity *= 3.0f;
                    BulletCenterDance c = GameObject.Instantiate (((Satori)owner).RevolveCircleResources.GetComponent<RevolveCircleResource> ().RevolveCircle, owner.transform.position, Quaternion.identity).GetComponent<BulletCenterDance> ();
                    c.Valocity = valocity;
                    GameObject.Destroy (c.gameObject, 5f);
                }
    
    
    
            }
            if (timeC<0) {
                timeC += 0.3f;
                for (int i = 0; i < 4; i++) {
                    Vector2 StartLocation = new Vector2 (Mathf.Cos (t), Mathf.Sin (t));
                    Vector2 valocity = new Vector2 (2f * Mathf.Cos (2f * t + i * Mathf.PI / 2), 2f * Mathf.Sin (2f * t + i * Mathf.PI / 2));
                    BulletCenterDance r = GameObject.Instantiate (((Satori)owner).RevolveCircleResources.GetComponent<RevolveCircleResource> ().BulletTriangle, owner.transform.position + (Vector3)StartLocation, Quaternion.identity).GetComponent<BulletCenterDance> ();
                    r.Valocity = valocity;
                    GameObject.Destroy (r.gameObject, 10f);
                }
                for (int i = 0; i < 4; i++) {
                    Vector2 StartLocation = new Vector2 (-Mathf.Cos (t), Mathf.Sin (t));
                    Vector2 valocity = new Vector2 (-2f * Mathf.Cos (2f * t + i * Mathf.PI / 2), 2f * Mathf.Sin (2f * t + i * Mathf.PI / 2));
                    BulletCenterDance r = GameObject.Instantiate (((Satori)owner).RevolveCircleResources.GetComponent<RevolveCircleResource> ().BulletTriangle, owner.transform.position + (Vector3)StartLocation, Quaternion.identity).GetComponent<BulletCenterDance> ();
                    r.Valocity = valocity;
                    GameObject.Destroy (r.gameObject, 10f);
                }
            }
        }
                
    
    
    }
    
    
    

    RevolveCircleResources:

    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    
    public class RevolveCircleResource : MonoBehaviour {
    
        public GameObject RevolveCircle; //
        public GameObject BulletTriangle; //
        // Use this for initialization
        void Start () {
            
        }
        
        // Update is called once per frame
        void Update () {
            
        }
    }
    
    

    转载于:https://www.cnblogs.com/1997Ff/p/7498400.html

    展开全文
  • 东方弹幕游戏!!!

    2018-02-22 20:18:00
    package com.totoo.TouhouMassLight...import android.app.Activity;import android.graphics.Bitmap;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android...

    package com.totoo.TouhouMassLight;


    import android.app.Activity;
    import android.graphics.Bitmap;
    import android.graphics.Canvas;
    import android.graphics.Color;
    import android.graphics.Paint;
    import android.os.Build;
    import android.os.Bundle;
    import android.os.Handler;
    import android.os.Message;
    import android.util.DisplayMetrics;
    import android.view.KeyEvent;
    import android.view.MotionEvent;
    import android.view.View;
    import android.view.Window;
    import android.view.WindowManager;
    import android.view.animation.Animation;
    import android.view.animation.RotateAnimation;
    import android.widget.HorizontalScrollView;
    import android.widget.TextView;

    import com.totoo.TouhouMassLight.creature.NewHero;
    import com.totoo.TouhouMassLight.creature.NewMagic;
    import com.totoo.TouhouMassLight.creature.NewSuperShow;
    import com.totoo.TouhouMassLight.util.ContorlView;

    public class FullscreenActivity extends Activity {
    static Canvas GameCan = null;
    static Paint drawSome = null;
    public static final Double UITpersent = 0.25;
    public static final Double UIpersent2 = 0.2;
    public int SW = 480;
    public int SH = 768;
    public int EarthLine = (int) (SH * 0.62);
    int TouchArceH = (int) (SH * UITpersent);
    int TouchArceW = (int) (SW * UITpersent);
    int LeftDivede = (int) (SW * UITpersent);
    int RightDivede = (int) (SW * UITpersent * 3);
    int HighDivede = (int) (SH * UIpersent2);
    int MiddleDivede = (int) (SH * UIpersent2 * 2);
    int Center = (int) (SH * 0.8);
    int LowDivede = (int) (SH * UIpersent2 * 3);
    static NewHero molisha;
    static NewHero reimei;
    static int MapBodderX;
    static int MapBodderY;
    int[][] WorldMap;
    int[][] mapCache;
    int x;
    int y;
    int[] tagetXY;

    // Bitmap bgPic;
    Canvas CMain = null;
    Bitmap bMap = null;
    Bitmap bSCmap = null;
    // NotificationManager nm;
    // Notification n;
    DisplayMetrics dm;
    public static GameViewNew gv;
    String AlretString = "look there";
    NewSuperShow RSS;
    NewSuperShow MSS;
    View view;
    public static ContorlView contorlView;
    protected Handler mHandler;

    // OrientationEventListener mOrientationListener;
    private HorizontalScrollView horizontalScrollView1;
    protected TextView HeathTextView;

    private int NewMagicListSize = 72;
    protected int _pixiv;
    private boolean ExitGame = false;
    Runnable thread;
    Thread game;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    // ȫ���ö�
    prepare(0);
    game = new Thread(thread);
    thread = new GameThread();
    game.start();
    }


    @Override
    protected void onRestart() {
    super.onRestart();
    ExitGame = false;
    }


    protected void prepare(int degare) {
    initGameSource();
    HeathTextView = initUI(_pixiv = 8);
    mHandler = new GameUIHandler(HeathTextView, FullscreenActivity.this, gv);

    gv.getBoder(SW, SH, _pixiv);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    gv.setRotationX(25);
    }
    // gv.flashThem();
    }
    //void registListener(){
    // if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    // gv.setRotationX(45);
    // }
    // mOrientationListener = new OrientationEventListener(this, SensorManager.SENSOR_DELAY_NORMAL) {
    // @Override
    // public void onOrientationChanged(int orientation) {
    // // Log.v(DEBUG_TAG, "Orientation changed to " + orientation);
    // if (orientation > 350 || orientation < 10) { // 0��
    // if (0 == orientation) {
    prepare(0);
    // } else
    // orientation = 0;
    // } else if (orientation > 80 && orientation < 100) { // 90��
    // if (90 == orientation) {
    prepare(90);
    // } else
    // orientation = 90;
    // } else if (orientation > 170 && orientation < 190) { // 180��
    // if (180 == orientation) {
    prepare(180);
    // } else
    // orientation = 180;
    // } else if (orientation > 260 && orientation < 280) { // 270��
    // if (270 == orientation) {
    prepare(270);
    // } else
    // orientation = 270;
    // } else {
    // return;
    // } // http://blog.csdn.net/goldenfish1919/article/details/47423131
    //
    // }
    // };
    // if (mOrientationListener.canDetectOrientation()) {
    // // Log.v(DEBUG_TAG, "Can detect orientation");
    // mOrientationListener.enable();
    // } else {
    // // Log.v(DEBUG_TAG, "Cannot detect orientation");
    // mOrientationListener.disable();
    // }}
    // protected TextView initUI(int pixiv) {
    // if (0 != pixiv)
    // _pixiv = pixiv;
    // return initUI(0);
    // }


    protected TextView initUI(int pixiv) {// ����ϵ�y
    view = getLayoutInflater().inflate(R.layout.activity_fullscreen, null);
    setContentView(view);
    gv = (GameViewNew) view.findViewById(R.id.imageView1)
    // new GameView(this)
    ;
    contorlView = (ContorlView) findViewById(R.id.cl);
    TextView HeathTV = (TextView) view.findViewById(R.id.HeathTextView);
    return HeathTV;
    }

    // RotateAnimation animation2 = new RotateAnimation(0, degare + 45, SW / 2, SH / 4*3);
    // animation2.setRepeatMode(RotateAnimation.RESTART);
    // animation2.setFillAfter(true);
    // contorlView.setAnimation(animation);
    // animation2.start();
    // horizontalScrollView1 = (HorizontalScrollView) findViewById(R.id.horizontalScrollView1);
    // horizontalScrollView1.setMinimumHeight((int) gv.startY);


    protected void initGameSource() {// ��ʼ���[���YԴ
    dm = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(dm);
    SH = dm.heightPixels;
    SW = dm.widthPixels;
    EarthLine = (int) (SH * 0.62);
    Center = (int) (SH * 0.7);
    TouchArceH = (int) (SH * UITpersent);
    TouchArceW = (int) (SW * UITpersent);
    LeftDivede = (int) (SW * UITpersent);
    RightDivede = (int) (SW * UITpersent * 3);
    HighDivede = (int) (SH * UIpersent2);
    MiddleDivede = (int) (SH * UIpersent2 * 2);
    Center = (int) (SH * 0.8);
    LowDivede = (int) (SH * UIpersent2 * 3);
    drawSome = new Paint();
    drawSome.setColor(Color.RED);

    }

    @Override
    protected void onResume() {
    super.onResume();
    }

    @Override
    protected void onPause() {
    // thread.stop();
    super.onPause();
    }

    @Override
    protected void onDestroy() {
    super.onDestroy();
    // mOrientationListener.disable();

    }


    protected RotateAnimation startAnimate(int degare, View viewObj) {

    RotateAnimation animation = new RotateAnimation(0, degare + 45, SW / 2, SH / 2);
    animation.setAnimationListener(new Animation.AnimationListener() {

    @Override
    public void onAnimationStart(Animation arg0) {

    }

    @Override
    public void onAnimationRepeat(Animation arg0) {

    }

    @Override
    public void onAnimationEnd(Animation arg0) {

    }
    });
    viewObj.setAnimation(animation);
    // animation.setRepeatMode(RotateAnimation.RESTART);
    animation.setFillAfter(true);
    return animation;
    }
    // void comfrimMap() {// ���µ؈D���
    // if (null != mapCache) {
    // WorldMap = mapCache;
    // }
    // }

    @Override
    public boolean onTouchEvent(MotionEvent event) {// ���²�׽
    int ia = event.getAction();
    int x = (int) event.getX();
    int y = (int) event.getY();
    gv.TouchX = x;
    gv.TouchY = y;
    if (MotionEvent.ACTION_DOWN == event.getAction())
    pressACircle();
    else
    PressKey(x, y);
    return super.onTouchEvent(event);
    }

    private void pressACircle() {
    // TODO Auto-generated method stub

    }

    boolean PressKey(int x, int y) {// ���I푑�
    TouchArce();
    if (gv.NewMagicList.size() < NewMagicListSize)
    gv.NewMagicList.add(new NewMagic(AlretString, gv.molisha.getXinMap() > x ? -1 : 1, //
    gv.molisha.getYinMap() > y ? -1 : 1, //
    gv.molisha, gv.TouchX, gv.TouchY));
    else
    for (int i = 0; i < NewMagicListSize; i++) {
    gv.NewMagicList.get(i).DeractionInX = gv.molisha.getXinMap() > x ? -1 : 1;
    gv.NewMagicList.get(i).DeractionInY = gv.molisha.getYinMap() > y ? -1 : 1;

    }
    return false;
    }

    boolean TouchArce() {// �օ^��׽ϵ�y
    if (gv.TouchX < LeftDivede) {// �ұ�
    if (gv.TouchY < HighDivede) {// �����
    // tz("�����");
    SSA();
    } else if (gv.TouchY < MiddleDivede) {// �����
    // tz("�����");
    WSA();
    } else if (gv.TouchY < LowDivede) {// �w���I
    // tz("�w���I");
    PF();
    } else {// ����
    // tz("����");
    PL();
    }
    } else if (gv.TouchX < RightDivede) {// �м�
    if (gv.TouchY > Center) {// ����
    // tz("����");
    PD();
    } else {// ����
    // tz("����");
    PU();
    }
    } else {// ���

    if (gv.TouchY < HighDivede) {// ����1
    // tz("����1");
    SC1();
    } else if (gv.TouchY < MiddleDivede) {// ����2
    // tz("����2");
    SC2();
    } else if (gv.TouchY < LowDivede) {// ����
    // tz("����");
    A();
    } else {// ����
    // tz("����");
    PR();
    }
    }

    return false;
    }


    class GameThread implements Runnable {
    Message msg;
    boolean exitflag = false;

    @Override
    public void run() {// �[�?�
    while (!exitflag && !Thread.currentThread().isInterrupted()) {
    try {
    Thread.sleep(100);
    } catch (InterruptedException e) {
    }
    if (ExitGame) {
    exitflag = true;
    game.interrupt();
    // Message msg = new Message();
    // msg.obj = true;
    // mHandler.sendMessage(msg);
    } else {
    contorlView.postInvalidate();
    if (!gv.molisha.isGameExit()) {//是否绘制
    gv.postInvalidate();
    mHandler.sendEmptyMessage(0);//交给
    }
    }
    }
    }
    }


    private void A() {

    }

    private void SC2() {

    }

    private void SC1() {

    }

    private void PU() {
    // molisha.setDescription(3);// ����
    // mapCache = molisha.moveUp(WorldMap, MapBodderX, MapBodderY);
    // comfrimMap();
    }

    private void PD() {
    // molisha.setDescription(1);// ����
    // mapCache = molisha.moveDown(WorldMap, MapBodderX, MapBodderY);
    // comfrimMap();
    }

    private void PL() {
    // molisha.setDescription(2);// ����

    // mapCache = molisha.moveLeft(WorldMap, MapBodderX, MapBodderY);
    // comfrimMap();
    }

    private void PR() {
    // molisha.setDescription(0);// ����
    // mapCache = molisha.moveRight(WorldMap, MapBodderX, MapBodderY);
    // comfrimMap();
    }

    private void PF() {

    }

    private void WSA() {

    }

    private void SSA() {

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { //按下的如果是BACK,同时没有重复
    // Toast.makeText("lyj_test","now_is_back_event",1).show();
    ExitGame = true;
    try {
    Thread.sleep(500);
    } catch (InterruptedException e) {
    e.printStackTrace();
    }
    game = null;
    // game.destroy();
    // game.stop();
    // game.exit = true; // 终止线程thread
    // game.join();
    finish();
    return true;

    }
    return super.onKeyDown(keyCode, event);
    }
    // 2、重写onBackPressed方法
    //
    // Android 2.0开始又多出了一种新的方法,对于Activity 可以单独获取Back键的按下事件,直接重写onBackPressed方法即可,代码如下

    @Override
    public void onBackPressed() {
    // 这里处理逻辑代码,大家注意:该方法仅适用于2.0或更新版的sdk
    return;
    }
    }

     

    动漫迎春贺图:祝大家狗年大吉 狗年告别单身狗

    2018-02-16 11:59:03 来源:pixiv 作者:未知 编辑:祈求 浏览:55744

    游民星空
    67288091

    游民星空
    66567522

    游民星空
    67242435

    游民星空
    65881016

    上一页 1 2 3 4 5 6 7 8 下一页
    友情提示:支持键盘左右键“← →”翻页

    用手机访问
    下载APP
    appicon下载
    扫一扫,手机浏览
    code
    http://acg.gamersky.com/pic/201802/1015669_7.shtml

    转载于:https://www.cnblogs.com/totoo/p/youbang.html

    展开全文
  • 东方project的弹幕美学

    2019-10-05 13:19:19
    弹幕射击游戏,也就是子弹像...东方Project的弹幕又跟很多的弹幕游戏不一样,这里我会配合下截图说下东方的特别之处 1.弹幕组成各种几何图形,给人一种美感 东方的弹幕除了一部分无规则的子弹之外,还会组成各...

    弹幕射击游戏,也就是子弹像暴雨般倾泻而下的卷轴射击游戏。这种游戏要求玩家在操纵飞机攻击敌人的同时也要躲避敌人的子弹威胁,但是和一般的卷轴射击空战游戏不同,这种游戏拥有大量的子弹,对玩家的反应要求非常高。

    东方Project的弹幕又跟很多的弹幕游戏不一样,这里我会配合下截图说下东方的特别之处

    1.弹幕组成各种几何图形,给人一种美感

    东方的弹幕除了一部分无规则的子弹之外,还会组成各种几何图形,这些弹幕有放射状的,也有像结界一样将区域划分成一块一块的,给人一种特别的美感。上图出自东方绀珠传

    2.各有特色的符卡

    boss战斗进入一定阶段之后会触发,类似于boss的大招宣言,这时候弹幕会围绕这这个符卡进行攻击

     符卡触发后boss的符卡宣言

    符卡的特殊攻击机制

    符卡的特殊机制:动物弹

    转载于:https://www.cnblogs.com/yoomuchan/p/6821650.html

    展开全文
  • 弹幕射击小游戏

    热门讨论 2012-12-16 22:45:29
    模仿东方永夜抄,开发的C++弹幕游戏,包括素材、源码
  • package com.totoo.TouhouMassLight...import android.app.Activity;import android.graphics.Bitmap;import android.graphics.Canvas;import android.graphics.Color;import android.graphics.Paint;import android...

    package com.totoo.TouhouMassLight;


    import android.app.Activity;
    import android.graphics.Bitmap;
    import android.graphics.Canvas;
    import android.graphics.Color;
    import android.graphics.Paint;
    import android.os.Build;
    import android.os.Bundle;
    import android.os.Handler;
    import android.os.Message;
    import android.util.DisplayMetrics;
    import android.view.KeyEvent;
    import android.view.MotionEvent;
    import android.view.View;
    import android.view.Window;
    import android.view.WindowManager;
    import android.view.animation.Animation;
    import android.view.animation.RotateAnimation;
    import android.widget.HorizontalScrollView;
    import android.widget.TextView;

    import com.totoo.TouhouMassLight.creature.NewHero;
    import com.totoo.TouhouMassLight.creature.NewMagic;
    import com.totoo.TouhouMassLight.creature.NewSuperShow;
    import com.totoo.TouhouMassLight.util.ContorlView;

    public class FullscreenActivity extends Activity {
    static Canvas GameCan = null;
    static Paint drawSome = null;
    public static final Double UITpersent = 0.25;
    public static final Double UIpersent2 = 0.2;
    public int SW = 480;
    public int SH = 768;
    public int EarthLine = (int) (SH * 0.62);
    int TouchArceH = (int) (SH * UITpersent);
    int TouchArceW = (int) (SW * UITpersent);
    int LeftDivede = (int) (SW * UITpersent);
    int RightDivede = (int) (SW * UITpersent * 3);
    int HighDivede = (int) (SH * UIpersent2);
    int MiddleDivede = (int) (SH * UIpersent2 * 2);
    int Center = (int) (SH * 0.8);
    int LowDivede = (int) (SH * UIpersent2 * 3);
    static NewHero molisha;
    static NewHero reimei;
    static int MapBodderX;
    static int MapBodderY;
    int[][] WorldMap;
    int[][] mapCache;
    int x;
    int y;
    int[] tagetXY;

    // Bitmap bgPic;
    Canvas CMain = null;
    Bitmap bMap = null;
    Bitmap bSCmap = null;
    // NotificationManager nm;
    // Notification n;
    DisplayMetrics dm;
    public static GameViewNew gv;
    String AlretString = "look there";
    NewSuperShow RSS;
    NewSuperShow MSS;
    View view;
    public static ContorlView contorlView;
    protected Handler mHandler;

    // OrientationEventListener mOrientationListener;
    private HorizontalScrollView horizontalScrollView1;
    protected TextView HeathTextView;

    private int NewMagicListSize = 72;
    protected int _pixiv;
    private boolean ExitGame = false;
    Runnable thread;
    Thread game;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    // ȫ���ö�
    prepare(0);
    game = new Thread(thread);
    thread = new GameThread();
    game.start();
    }


    @Override
    protected void onRestart() {
    super.onRestart();
    ExitGame = false;
    }

    protected void prepare(int degare) {
    initGameSource();
    HeathTextView = initUI(_pixiv = 8);
    mHandler = new GameUIHandler(HeathTextView, FullscreenActivity.this, gv);

    gv.getBoder(SW, SH, _pixiv);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    gv.setRotationX(25);
    }
    // gv.flashThem();
    }
    //void registListener(){
    // if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
    // gv.setRotationX(45);
    // }
    // mOrientationListener = new OrientationEventListener(this, SensorManager.SENSOR_DELAY_NORMAL) {
    // @Override
    // public void onOrientationChanged(int orientation) {
    // // Log.v(DEBUG_TAG, "Orientation changed to " + orientation);
    // if (orientation > 350 || orientation < 10) { // 0��
    // if (0 == orientation) {
    prepare(0);
    // } else
    // orientation = 0;
    // } else if (orientation > 80 && orientation < 100) { // 90��
    // if (90 == orientation) {
    prepare(90);
    // } else
    // orientation = 90;
    // } else if (orientation > 170 && orientation < 190) { // 180��
    // if (180 == orientation) {
    prepare(180);
    // } else
    // orientation = 180;
    // } else if (orientation > 260 && orientation < 280) { // 270��
    // if (270 == orientation) {
    prepare(270);
    // } else
    // orientation = 270;
    // } else {
    // return;
    // } // http://blog.csdn.net/goldenfish1919/article/details/47423131
    //
    // }
    // };
    // if (mOrientationListener.canDetectOrientation()) {
    // // Log.v(DEBUG_TAG, "Can detect orientation");
    // mOrientationListener.enable();
    // } else {
    // // Log.v(DEBUG_TAG, "Cannot detect orientation");
    // mOrientationListener.disable();
    // }}
    // protected TextView initUI(int pixiv) {
    // if (0 != pixiv)
    // _pixiv = pixiv;
    // return initUI(0);
    // }


    protected TextView initUI(int pixiv) {// ����ϵ�y
    view = getLayoutInflater().inflate(R.layout.activity_fullscreen, null);
    setContentView(view);
    gv = (GameViewNew) view.findViewById(R.id.imageView1)
    // new GameView(this)
    ;
    contorlView = (ContorlView) findViewById(R.id.cl);
    TextView HeathTV = (TextView) view.findViewById(R.id.HeathTextView);
    return HeathTV;
    }

    // RotateAnimation animation2 = new RotateAnimation(0, degare + 45, SW / 2, SH / 4*3);
    // animation2.setRepeatMode(RotateAnimation.RESTART);
    // animation2.setFillAfter(true);
    // contorlView.setAnimation(animation);
    // animation2.start();
    // horizontalScrollView1 = (HorizontalScrollView) findViewById(R.id.horizontalScrollView1);
    // horizontalScrollView1.setMinimumHeight((int) gv.startY);


    protected void initGameSource() {// ��ʼ���[���YԴ
    dm = new DisplayMetrics();
    getWindowManager().getDefaultDisplay().getMetrics(dm);
    SH = dm.heightPixels;
    SW = dm.widthPixels;
    EarthLine = (int) (SH * 0.62);
    Center = (int) (SH * 0.7);
    TouchArceH = (int) (SH * UITpersent);
    TouchArceW = (int) (SW * UITpersent);
    LeftDivede = (int) (SW * UITpersent);
    RightDivede = (int) (SW * UITpersent * 3);
    HighDivede = (int) (SH * UIpersent2);
    MiddleDivede = (int) (SH * UIpersent2 * 2);
    Center = (int) (SH * 0.8);
    LowDivede = (int) (SH * UIpersent2 * 3);
    drawSome = new Paint();
    drawSome.setColor(Color.RED);

    }

    @Override
    protected void onResume() {
    super.onResume();
    }

    @Override
    protected void onPause() {
    // thread.stop();
    super.onPause();
    }

    @Override
    protected void onDestroy() {
    super.onDestroy();
    // mOrientationListener.disable();

    }

    protected RotateAnimation startAnimate(int degare, View viewObj) {

    RotateAnimation animation = new RotateAnimation(0, degare + 45, SW / 2, SH / 2);
    animation.setAnimationListener(new Animation.AnimationListener() {

    @Override
    public void onAnimationStart(Animation arg0) {

    }

    @Override
    public void onAnimationRepeat(Animation arg0) {

    }

    @Override
    public void onAnimationEnd(Animation arg0) {

    }
    });
    viewObj.setAnimation(animation);
    // animation.setRepeatMode(RotateAnimation.RESTART);
    animation.setFillAfter(true);
    return animation;
    }
    // void comfrimMap() {// ���µ؈D���
    // if (null != mapCache) {
    // WorldMap = mapCache;
    // }
    // }

    @Override
    public boolean onTouchEvent(MotionEvent event) {// ���²�׽
    int ia = event.getAction();
    int x = (int) event.getX();
    int y = (int) event.getY();
    gv.TouchX = x;
    gv.TouchY = y;
    if (MotionEvent.ACTION_DOWN == event.getAction())
    pressACircle();
    else
    PressKey(x, y);
    return super.onTouchEvent(event);
    }

    private void pressACircle() {
    // TODO Auto-generated method stub

    }

    boolean PressKey(int x, int y) {// ���I푑�
    TouchArce();
    if (gv.NewMagicList.size() < NewMagicListSize)
    gv.NewMagicList.add(new NewMagic(AlretString, gv.molisha.getXinMap() > x ? -1 : 1, //
    gv.molisha.getYinMap() > y ? -1 : 1, //
    gv.molisha, gv.TouchX, gv.TouchY));
    else
    for (int i = 0; i < NewMagicListSize; i++) {
    gv.NewMagicList.get(i).DeractionInX = gv.molisha.getXinMap() > x ? -1 : 1;
    gv.NewMagicList.get(i).DeractionInY = gv.molisha.getYinMap() > y ? -1 : 1;

    }
    return false;
    }

    boolean TouchArce() {// �օ^��׽ϵ�y
    if (gv.TouchX < LeftDivede) {// �ұ�
    if (gv.TouchY < HighDivede) {// �����
    // tz("�����");
    SSA();
    } else if (gv.TouchY < MiddleDivede) {// �����
    // tz("�����");
    WSA();
    } else if (gv.TouchY < LowDivede) {// �w���I
    // tz("�w���I");
    PF();
    } else {// ����
    // tz("����");
    PL();
    }
    } else if (gv.TouchX < RightDivede) {// �м�
    if (gv.TouchY > Center) {// ����
    // tz("����");
    PD();
    } else {// ����
    // tz("����");
    PU();
    }
    } else {// ���

    if (gv.TouchY < HighDivede) {// ����1
    // tz("����1");
    SC1();
    } else if (gv.TouchY < MiddleDivede) {// ����2
    // tz("����2");
    SC2();
    } else if (gv.TouchY < LowDivede) {// ����
    // tz("����");
    A();
    } else {// ����
    // tz("����");
    PR();
    }
    }

    return false;
    }

    class GameThread implements Runnable {
    Message msg;
    boolean exitflag = false;

    @Override
    public void run() {// �[�?�
    while (!exitflag && !Thread.currentThread().isInterrupted()) {
    try {
    Thread.sleep(100);
    } catch (InterruptedException e) {
    }
    if (ExitGame) {
    exitflag = true;
    game.interrupt();
    // Message msg = new Message();
    // msg.obj = true;
    // mHandler.sendMessage(msg);
    } else {
    contorlView.postInvalidate();
    if (!gv.molisha.isGameExit()) {//是否绘制
    gv.postInvalidate();
    mHandler.sendEmptyMessage(0);//交给
    }
    }
    }
    }
    }

    private void A() {

    }

    private void SC2() {

    }

    private void SC1() {

    }

    private void PU() {
    // molisha.setDescription(3);// ����
    // mapCache = molisha.moveUp(WorldMap, MapBodderX, MapBodderY);
    // comfrimMap();
    }

    private void PD() {
    // molisha.setDescription(1);// ����
    // mapCache = molisha.moveDown(WorldMap, MapBodderX, MapBodderY);
    // comfrimMap();
    }

    private void PL() {
    // molisha.setDescription(2);// ����

    // mapCache = molisha.moveLeft(WorldMap, MapBodderX, MapBodderY);
    // comfrimMap();
    }

    private void PR() {
    // molisha.setDescription(0);// ����
    // mapCache = molisha.moveRight(WorldMap, MapBodderX, MapBodderY);
    // comfrimMap();
    }

    private void PF() {

    }

    private void WSA() {

    }

    private void SSA() {

    }

    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
    if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) { //按下的如果是BACK,同时没有重复
    // Toast.makeText("lyj_test","now_is_back_event",1).show();
    ExitGame = true;
    try {
    Thread.sleep(500);
    } catch (InterruptedException e) {
    e.printStackTrace();
    }
    game = null;
    // game.destroy();
    // game.stop();
    // game.exit = true; // 终止线程thread
    // game.join();
    finish();
    return true;

    }
    return super.onKeyDown(keyCode, event);
    }
    // 2、重写onBackPressed方法
    //
    // Android 2.0开始又多出了一种新的方法,对于Activity 可以单独获取Back键的按下事件,直接重写onBackPressed方法即可,代码如下

    @Override
    public void onBackPressed() {
    // 这里处理逻辑代码,大家注意:该方法仅适用于2.0或更新版的sdk
    return;
    }
    }

    学习u3d中

     

    转载于:https://www.cnblogs.com/totoo/articles/youbangxin.html

    展开全文
  • 开发环境 Win10, Cocos2d-x v3.16, Visual Studio 2017, Visual Studio Code 项目阐述 ...游戏的设计主要借鉴了东方系列的弹幕游戏,借鉴内容包括pop子发射的各种弹,以及部分的关卡设计。 ...
  • 了解微信小游戏 官方文档有详细的介绍 小游戏的文件结构 我们以新建一个官方示例说明 如图 最外层除了readme外 有3个文件 game.js 程序入口 game.json小游戏配置文件 project.config.json 项目设置文件 具体...
  • 前言在上篇中只介绍了两种弹幕样式的生成,很明显对于一款弹幕游戏来说是远远不够的,所以本次就再来尝试还原一下东方的两种弹幕,反射子弹和曲线激光。同样的先来看看效果反射子弹曲线激光本文主要内容:控制子弹的...
  • 还记得被东方project弹幕支配的恐惧吗——————————————————————如何用construct2做一个简易的弹幕游戏游戏链接http://1.projectboli.applinzi.com/当然,开始的开始,还是需要大家下载安装free...
  • 四圣龙神录 官网地址 ...开源仿东方STG-四圣龙神录,带弹幕制作教程60讲,使用C语言+DXLib 非常不错的仿东方的STG,网站上面带制作教程,可以用来参考。 附带60讲教程详细介绍怎样修改他的弹幕STG工
  • 我最近开坑了一个类似东方project的弹幕游戏制作,由于之前没有经验(也就是说我是个小白),遇到弹幕碰撞时产生如下问题: 我有敌人的ArrayList<Enemy> 也有玩家的弹幕...
  • 提到弹幕游戏,想到的最多的应该是《东方Project》系列了吧 酷炫的弹幕~~酷炫的弹幕~~我只记得酷炫。。。。   今天我们也来实现一个仿制版,阉割版~   关于弹幕游戏,有篇文章写的不错。我也就不重复写了...
  • 系列中主要形式是飞机弹幕游戏,也有格斗游戏,本次我进行了新的尝试,设计了一款简单的Rpg探索解谜类游戏。用户在一个屋子里醒来,通过不断探索获得道具达成条件,避开死亡点,了解到整个故事并从...
  • Teki() Teki是系列的开源同人游戏,使用和OpenGL用Rust编写。 建筑 由于teki依赖于SDL2,因此您首先需要。...Z导致短时发射弹幕; 它可能会被按住以进行急速射击 Esc暂停游戏,并带您进入游戏内菜单
  • codves 2547 东方辉针城

    2016-10-16 17:08:02
    codves 2547 东方辉针城...在游戏中,你需要躲避他人的弹幕,并发射出自己的弹幕来攻击对方。本题中,为简单起见,只考虑对方发射的弹幕。假设主角始终处于画面低端,将每秒与主角出现在一排的弹幕进行叠加,总共游戏
  • 游戏中,你需要躲避他人的弹幕,并发射出自己的弹幕来攻击对方。本题中,为简单起见,只考虑对方发射的弹幕。 假设主角始终处于画面低端,将每秒与主角出现在一排的弹幕进行叠加,总共游戏进行了T秒,可
  • 游戏中,你需要躲避他人的弹幕,并发射出自己的弹幕来攻击对方。本题中,为简单起见,只考虑对方发射的弹幕。 假设主角始终处于画面低端,将每秒与主角出现在一排的弹幕进行叠加,总共游戏进行了T秒,可以形成一...
  • Codevs 2547 东方辉针城

    千次阅读 2016-06-10 21:18:55
    2547 东方辉针城 时间限制: 1 s 空间限制: 32000 KB 题目等级 : 黄金 Gold 题目描述 Description ...在游戏中,你需要躲避他人的弹幕,并发射出自己的弹幕来攻击对方。本题中,为简单起见,只考虑对方发
  • 最近想做个东方原曲个人向Top50,编排MV过程中,觉得部分元素可以自动化产生(例如进场配图丶游戏画面皆能爬虫取得),而且比较少有同时包含配图和弹幕画面的原曲MV(个人认为弹幕也是欣赏东方原曲不可缺少的要素之...
  • HTML5 Canvas 竖版飞行射击游戏的实现

    千次阅读 2011-12-19 15:10:43
    这个游戏本来是想做成东方那个的虐心弹幕游戏的。一是由于本人美工方面的问题,二是阿里云应用开发失败之后我也没有动力继续做下去了。 不过其本身已经是一个相对完整的游戏了,虽然怪物和弹幕类型都比较少,但是想...
  • 于是胡乱搞了很久,前后搞了弹幕射击类(模拟东方project系列)、ARPG和这次的AVG(文字冒险)。这次的文字冒险游戏由于有前几次的经验积累,耗时5天成功开发了出来。于是准备在这里总结下用pygame开发游戏的经验,大...
  • 不知道大家有没有接触过东方project系列弹幕射击游戏, 曾带给过小编无数个寂静夜里的快乐与孤独。 从上白泽慧音打到蓬莱山辉夜, 而在EXTRA番外里,这首属于藤原妹红的BGM响起时, 意味着新一轮的循环又已结束。 ...
  • 概述 大约两年前接触了python,然后就爱上了这个语言。...于是胡乱搞了很久,前后搞了弹幕射击类(模拟东方project系列)、ARPG和这次的AVG(文字冒险)。这次的文字冒险游戏由于有前几次的经验积累,耗时5天成功开...
  • CodeBlocks 10.05 配置DxLib v3.09

    千次阅读 2012-12-02 22:55:07
    出于对东方的喜爱,也想学习弹幕游戏的设计。 之前看到一个教程,四圣龙神录, 是一个开源仿东方弹幕游戏教程。 60讲讲座地址(日文): http://dixq.net/rp/ 游戏主页: http://dixq.net/sr/ 看上去相当不错啊,...
  • 1、课程设计内容概述 1.1 目的 《东方project》系列简称东方,是日本同人游戏社团上海爱丽丝幻乐团所制作的一系列同人游戏、相关...系列中主要形式是飞机弹幕游戏,也有格斗游戏,本次我进行了新的尝试,设计...

空空如也

空空如也

1 2
收藏数 36
精华内容 14
关键字:

弹幕游戏东方