LoginSignup
0
0

cscの作法 その457

Posted at

概要

cscの作法、調べてみた。
DxLibDotNet.dll、使ってみた。
練習問題やってみた。

練習問題

爆発エフェクトを作れ。

写真

image.png

サンプルコード

using DxLibDLL;
using System;

class dxtest {
	[STAThread]
	static void Main() {
		int X = 0,
			Y = 0;
		int z = 0;
		int[] GrHandle = new int[9];
		int GNum = 0;
		int loopcnt = 0;
		DX.ChangeWindowMode(DX.TRUE);
		if (DX.DxLib_Init() == -1) 
			return;
		int s = DX.LoadSoundMem("small_explosion1.mp3");
		DX.LoadDivGraph("bon.png", 9, 3, 3, 170, 170, GrHandle);
		DX.SetDrawScreen(DX.DX_SCREEN_BACK);
		while (DX.ProcessMessage() == 0)
		{
			DX.ClearDrawScreen();
			if ((DX.GetMouseInput() & DX.MOUSE_INPUT_LEFT) != 0)
			{
				DX.GetMousePoint(out X, out Y);
				z = 1;
			}
			if (z == 1)
			{
				loopcnt++;
				if (loopcnt % 25 == 24)
				{
					if (GNum < 8)
					{
						GNum++;
					}
					else
					{
						GNum = 0;
						z = 0;
						DX.PlaySoundMem(s, DX.DX_PLAYTYPE_BACK);
					}
				}
				DX.DrawGraph(X - 80, Y - 80, GrHandle[GNum], DX.TRUE);
			}
			DX.ScreenFlip();
		}
		DX.DxLib_End();
	}
}










以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0