5/8はビジネスデーなので、一般の方で遊びに来たい方は5/9か5/10にお越しください。僕のブースはB-02です。他にも色々な開発者の方々が出展していますので、珍しいゲームでいっぱい遊べると思います。ぜひどうぞ。
インディー界で有名な稲船さんの「Mighty No.9」もプレイアブル出展だそうですよ。
ではー。
Bad Smell Queueについてはこちら:http://xionchannel.no-ip.org/badsmell/
開発とか実験とか、勉強会参加とかしてます。
SubShader {
Tag { "LightMode" = "VertexLMRGBM" }
}
SubShader {
Tag { "LightMode" = "VertexLM" }
}
SubShader {
Pass {
Tag { "LightMode" = "VertexLMRGBM" }
}
Pass {
Tag { "LightMode" = "VertexLM" }
}
}
SubShader {
Pass {
Lighting Off
}
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
struct v2f {
float4 pos : SV_POSITION;
fixed2 uv : TEXCOORD0;
fixed3 col : COLOR;
}
v2f vert(appdata_base v) {
v2f o;
頂点演算は省きます。
o.col.rgb = _LightColor0.rgb;
}
フラグメントシェーダーは省きます。
ENDCG
}
Tag {
"LightMode" = "Vertex"
}
struct v2f {
float4 pos : SV_POSITION;
fixed2 uv : TEXCOORD0; <これとか
fixed custom : TEXCOORD1; <これとか
half4 custom2; <これはだめ
}


+(MainScene*)sceneWithLayerTop:(CCLayer*)layerTop
layerBelow:(CCLayer*)layerBelow
{
MainScene *scene = [MainScene node];
layerTop.tag = kLayerTop;
layerBelow.tag = kLayerBelow;
[scene addChild:layerBelow z:0];
[scene addChild:layerTop z:2];
return scene;
}
- (BOOL)transitionFadeWithLayer:(CCLayer*)layer
duration:(ccTime)d;
- (BOOL)transitionFlowerWithLayer:(CCLayer*)layer
duration:(ccTime)d;














@interface gmChara : CCNode(あるいはNSObject) {
CCSprite *sprite; //キャラクター用スプライト
CGPoint accel; //加速度
int vital; //体力
...などなど
}
@interface gmChara : CCSprite {
CGPoint accel; //加速度
int vital; //体力
...などなど
}
[sprite setTextureRect:CGRECT_FOR_NEW];

CCTexture2D *texture =
[[CCTextureCache sharedTextureCache]
addImage:TEXTURE_FILE_NAME];
NSMutableArray *animFrames = [NSMutableArray array];
for (int x=0; x<8; x++) {
CCSpriteFrame *frame =
[CCSpriteFrame frameWithTexture:texture
rectInPixels:CGRectMake(64*x, 0, 64, 64)
rotated:FALSE
offset:CGPointZero
originalSize:CGSizeMake(64, 64)];
[animFrames addObject:frame];
}
CCAnimation *animation =
[CCAnimation animationWithFrames:animFrames
delay:0.3f];
CCRepeatForever *action =
[CCRepeatForever actionWithAction:
[CCAnimate actionWithAnimation:animation
restoreOriginalFrame:NO]];
[sprite stopAllActions];
[sprite runAction:action];
[sprite runAction:[[action copy] autorelease]];
@interface gmChara : CCSprite {
CCArray *actions; //パターンアニメーション保持用
...などなど
}
[sprite runAction:[actions objectAtIndex:0]];
id action = [[[actions objectAtIndex:0] copy] autorelease];
[sprite runAction:[CCRepeatForever actionWithAction:action]];



まずは、ドットを打って文字をデザインしていきます。要領はドット絵と同じですね。作りを簡単にするには等幅フォントがいいので、その場合は、格子状に文字を配置しながらデザインしていきます。//指定のキャラクターのCGRectを返す
- (CGRect)getRectWithASCII:(char)ascii {
char c;
if (ascii>='0' && ascii<='9') {
c = ascii-'0';
}
else if (ascii>='A' && ascii<='Z') {
c = ascii-'A'+10;
}
else if (ascii=='!') { //!
c = ('Z'-'A'+10)+1;
}
<中略>
else {
c = ('Z'-'A'+10)+8; //スペースに置き換える
}
return CGRectMake(8*(c%8), 8*(c/8), 8, 8);
}
レトロ風味から少し高級な印象になりますが、プロポーショナルフォントは見た目に美しいので、それをつくろうとする場合はどうしましょうか。はい。それぞれの文字の幅が異なる可能性があるので、その情報をどこかに持たなければなりません。
//指定のキャラクターのCGRectを返す
- (CGRect)getRectWithString:(NSString*)s {
NSArray *rect = [characters objectForKey:s];
if (rect) {
float x = [[rect objectAtIndex:0] intValue];
float y = [[rect objectAtIndex:1] intValue];
float width = [[rect objectAtIndex:2] intValue];
float height = [[rect objectAtIndex:3] intValue];
return CGRectMake(x, y, width, height);
}
else {
return CGRectZero;
}
}
//文字スプライトの初期化(private)
- (CCSprite*) __makeCharacterSpriteFrame:(CCSpriteFrame*)f
string:(NSString*)c
position:(CGPoint*)pos
isShadow:(BOOL)isShadow
{
CCSprite *s = [CCSprite spriteWithSpriteFrame:f];
[s.texture setAliasTexParameters];
s.anchorPoint = ccp(0,0);
s.scale = 2.0f;
if (![c compare:@"゛"] || ![c compare:@"゜"]) { //濁点・半濁点
s.position = ccp(pos->x -4*2, pos->y +8*2);
}
else {
s.position = *pos;
if (!isShadow) pos->x += s.contentSize.width*2;
}
return s;
}
//カタカナの濁点等を分解する(private)
- (NSString*) __correctString:(NSString*)string {
NSMutableString *ret = [NSMutableString string];
for (int i=0; i < string.length; i++) {
NSString *c = [string substringWithRange:
NSMakeRange(i, 1)];
NSString *replace;
if ((replace = [self.dakuten objectForKey:c])) {
//濁点の差し替えがあれば差し替える
[ret appendString:replace];
}
else {
[ret appendString:c];
}
}
return ret;
}