sigonasr2, Sig, Sigo 2 years ago committed by GitHub
commit 0afec767d2
  1. 66
      UpdatedPallete.css
  2. BIN
      maps/world1.map
  3. 69
      mulfok32-1x.png-palette.gpl.gpl
  4. 23
      src/sig/DrawLoop.java
  5. 49
      src/sig/engine/Panel.java
  6. 6
      src/sig/engine/objects/Object.java
  7. 1
      src/sig/objects/BunnyGirls.java
  8. 4
      src/sig/objects/EditorRenderer.java
  9. 13
      src/sig/objects/LevelRenderer.java
  10. 1
      src/sig/objects/Player.java

@ -0,0 +1,66 @@
/* Generated with GIMP Palette Export */
.Untitled { color: rgb(91, 166, 117) }
.Untitled { color: rgb(107, 201, 108) }
.Untitled { color: rgb(171, 221, 100) }
.Untitled { color: rgb(252, 239, 141) }
.Untitled { color: rgb(255, 184, 121) }
.Untitled { color: rgb(234, 98, 98) }
.Untitled { color: rgb(204, 66, 94) }
.Untitled { color: rgb(163, 40, 88) }
.Untitled { color: rgb(117, 23, 86) }
.Untitled { color: rgb(57, 9, 71) }
.Untitled { color: rgb(97, 24, 81) }
.Untitled { color: rgb(135, 53, 85) }
.Untitled { color: rgb(166, 85, 95) }
.Untitled { color: rgb(201, 115, 115) }
.Untitled { color: rgb(242, 174, 153) }
.Untitled { color: rgb(255, 195, 242) }
.Untitled { color: rgb(238, 143, 203) }
.Untitled { color: rgb(212, 110, 179) }
.Untitled { color: rgb(135, 62, 132) }
.Untitled { color: rgb(31, 16, 42) }
.Untitled { color: rgb(74, 48, 82) }
.Untitled { color: rgb(123, 84, 128) }
.Untitled { color: rgb(166, 133, 159) }
.Untitled { color: rgb(217, 189, 200) }
.Untitled { color: rgb(255, 255, 255) }
.Untitled { color: rgb(174, 226, 255) }
.Untitled { color: rgb(141, 183, 255) }
.Untitled { color: rgb(109, 128, 250) }
.Untitled { color: rgb(132, 101, 236) }
.Untitled { color: rgb(131, 77, 196) }
.Untitled { color: rgb(125, 45, 160) }
.Untitled { color: rgb(78, 24, 124) }
.Untitled { color: rgb(255, 0, 255) }
.Untitled { color: rgb(87, 157, 147) }
.Untitled { color: rgb(101, 188, 141) }
.Untitled { color: rgb(158, 206, 137) }
.Untitled { color: rgb(232, 222, 162) }
.Untitled { color: rgb(234, 173, 149) }
.Untitled { color: rgb(215, 99, 136) }
.Untitled { color: rgb(188, 74, 134) }
.Untitled { color: rgb(151, 58, 131) }
.Untitled { color: rgb(109, 50, 130) }
.Untitled { color: rgb(58, 45, 123) }
.Untitled { color: rgb(92, 50, 127) }
.Untitled { color: rgb(125, 65, 129) }
.Untitled { color: rgb(153, 88, 134) }
.Untitled { color: rgb(185, 113, 146) }
.Untitled { color: rgb(222, 164, 171) }
.Untitled { color: rgb(234, 182, 240) }
.Untitled { color: rgb(219, 137, 208) }
.Untitled { color: rgb(195, 109, 190) }
.Untitled { color: rgb(125, 71, 156) }
.Untitled { color: rgb(39, 47, 113) }
.Untitled { color: rgb(72, 62, 128) }
.Untitled { color: rgb(115, 88, 154) }
.Untitled { color: rgb(153, 128, 175) }
.Untitled { color: rgb(200, 177, 206) }
.Untitled { color: rgb(234, 236, 251) }
.Untitled { color: rgb(161, 210, 251) }
.Untitled { color: rgb(131, 172, 251) }
.Untitled { color: rgb(102, 124, 246) }
.Untitled { color: rgb(123, 101, 235) }
.Untitled { color: rgb(122, 82, 203) }
.Untitled { color: rgb(116, 60, 176) }
.Untitled { color: rgb(75, 50, 151) }

Binary file not shown.

@ -0,0 +1,69 @@
GIMP Palette
Name: mulfok32-1x.png palette.gpl
Columns: 16
#
91 166 117 Untitled
107 201 108 Untitled
171 221 100 Untitled
252 239 141 Untitled
255 184 121 Untitled
234 98 98 Untitled
204 66 94 Untitled
163 40 88 Untitled
117 23 86 Untitled
57 9 71 Untitled
97 24 81 Untitled
135 53 85 Untitled
166 85 95 Untitled
201 115 115 Untitled
242 174 153 Untitled
255 195 242 Untitled
238 143 203 Untitled
212 110 179 Untitled
135 62 132 Untitled
31 16 42 Untitled
74 48 82 Untitled
123 84 128 Untitled
166 133 159 Untitled
217 189 200 Untitled
255 255 255 Untitled
174 226 255 Untitled
141 183 255 Untitled
109 128 250 Untitled
132 101 236 Untitled
131 77 196 Untitled
125 45 160 Untitled
78 24 124 Untitled
255 0 255 Untitled
87 157 147 Untitled
101 188 141 Untitled
158 206 137 Untitled
232 222 162 Untitled
234 173 149 Untitled
215 99 136 Untitled
188 74 134 Untitled
151 58 131 Untitled
109 50 130 Untitled
58 45 123 Untitled
92 50 127 Untitled
125 65 129 Untitled
153 88 134 Untitled
185 113 146 Untitled
222 164 171 Untitled
234 182 240 Untitled
219 137 208 Untitled
195 109 190 Untitled
125 71 156 Untitled
39 47 113 Untitled
72 62 128 Untitled
115 88 154 Untitled
153 128 175 Untitled
200 177 206 Untitled
234 236 251 Untitled
161 210 251 Untitled
131 172 251 Untitled
102 124 246 Untitled
123 101 235 Untitled
122 82 203 Untitled
116 60 176 Untitled
75 50 151 Untitled

@ -80,7 +80,7 @@ public class DrawLoop {
} else { } else {
x=x2-1;y=y2-1;xe=x1; x=x2-1;y=y2-1;xe=x1;
} }
Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha); Draw(canvas,y*RabiClone.BASE_WIDTH+x,col);
while (x<xe) { while (x<xe) {
x=x+1; x=x+1;
if (px<0) { if (px<0) {
@ -93,7 +93,7 @@ public class DrawLoop {
} }
px=px+2*(dy1-dx1); px=px+2*(dy1-dx1);
} }
Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha); Draw(canvas,y*RabiClone.BASE_WIDTH+x,col);
} }
} else { } else {
if (dy>=0) { if (dy>=0) {
@ -101,7 +101,7 @@ public class DrawLoop {
} else { } else {
x=x2-1;y=y2-1;ye=y1; x=x2-1;y=y2-1;ye=y1;
} }
Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha); Draw(canvas,y*RabiClone.BASE_WIDTH+x,col);
while (y<ye) { while (y<ye) {
y=y+1; y=y+1;
if (py<=0) { if (py<=0) {
@ -114,7 +114,7 @@ public class DrawLoop {
} }
py=py+2*(dx1-dy1); py=py+2*(dx1-dy1);
} }
Draw(canvas,y*RabiClone.BASE_WIDTH+x,col,alpha); Draw(canvas,y*RabiClone.BASE_WIDTH+x,col);
} }
} }
} }
@ -124,7 +124,7 @@ public class DrawLoop {
for (int yy=0;yy<h;yy++) { for (int yy=0;yy<h;yy++) {
if (x+xx>=0&&y+yy>=0&&x+xx<RabiClone.BASE_WIDTH&&y+yy<RabiClone.BASE_HEIGHT) { if (x+xx>=0&&y+yy>=0&&x+xx<RabiClone.BASE_WIDTH&&y+yy<RabiClone.BASE_HEIGHT) {
int index = ((int)y+yy)*RabiClone.BASE_WIDTH+(int)x+xx; int index = ((int)y+yy)*RabiClone.BASE_WIDTH+(int)x+xx;
Draw(p,index,col, Alpha.ALPHA0); Draw(p,index,col);
} }
} }
} }
@ -193,7 +193,7 @@ public class DrawLoop {
if (sprite.getBi_array()[Y*sprite.getCanvasWidth()+X]==32||index<0||index>=p.length) { if (sprite.getBi_array()[Y*sprite.getCanvasWidth()+X]==32||index<0||index>=p.length) {
continue; continue;
} else { } else {
Draw(p,index,(col==PaletteColor.NORMAL)?sprite.getBi_array()[Y*sprite.getCanvasWidth()+X]:(byte)col.ordinal(),alpha); Draw(p,index,(col==PaletteColor.NORMAL)?sprite.getBi_array()[Y*sprite.getCanvasWidth()+X]:(byte)col.ordinal());
} }
} }
} }
@ -201,7 +201,14 @@ public class DrawLoop {
} }
} }
public static void Draw(byte[] canvas,int index, byte col, Alpha alpha) {
canvas[index]=(byte)(((int)(col)&0xff)+(alpha.ordinal()*(32)));
public static void Draw(byte[] canvas,int index, byte col) {
if(RabiClone.player!=null && RabiClone.player.isUnderwater()){
canvas[index]=(byte)((int)(col+33)&0xff);
}
else{
canvas[index]=(byte)((int)(col)&0xff);
}
} }
} }

@ -81,6 +81,39 @@ public class Panel extends JPanel implements Runnable,KeyListener {
(byte)0x83,(byte)0x4d,(byte)0xc4, (byte)0x83,(byte)0x4d,(byte)0xc4,
(byte)0x7d,(byte)0x2d,(byte)0xa0, (byte)0x7d,(byte)0x2d,(byte)0xa0,
(byte)0x4e,(byte)0x18,(byte)0x7c, (byte)0x4e,(byte)0x18,(byte)0x7c,
(byte)255,(byte) 0,(byte)255,
(byte) 87,(byte)157,(byte)147,
(byte)101,(byte)188,(byte)141,
(byte)158,(byte)206,(byte)137,
(byte)232,(byte)222,(byte)162,
(byte)234,(byte)173,(byte)149,
(byte)215,(byte) 99,(byte)136,
(byte)188,(byte) 74,(byte)134,
(byte)151,(byte) 58,(byte)131,
(byte)109,(byte) 50,(byte)130,
(byte) 58,(byte) 45,(byte)123,
(byte) 92,(byte) 50,(byte)127,
(byte)125,(byte) 65,(byte)129,
(byte)153,(byte) 88,(byte)134,
(byte)185,(byte)113,(byte)146,
(byte)222,(byte)164,(byte)171,
(byte)234,(byte)182,(byte)240,
(byte)219,(byte)137,(byte)208,
(byte)195,(byte)109,(byte)190,
(byte)125,(byte) 71,(byte)156,
(byte) 39,(byte) 47,(byte)113,
(byte) 72,(byte) 62,(byte)128,
(byte)115,(byte) 88,(byte)154,
(byte)153,(byte)128,(byte)175,
(byte)200,(byte)177,(byte)206,
(byte)234,(byte)236,(byte)251,
(byte)161,(byte)210,(byte)251,
(byte)131,(byte)172,(byte)251,
(byte)102,(byte)124,(byte)246,
(byte)123,(byte)101,(byte)235,
(byte)122,(byte) 82,(byte)203,
(byte)116,(byte) 60,(byte)176,
(byte) 75,(byte) 50,(byte)151,
}; };
public Panel(JFrame f) { public Panel(JFrame f) {
@ -159,21 +192,7 @@ public class Panel extends JPanel implements Runnable,KeyListener {
* @return color model * @return color model
*/ */
protected static ColorModel getCustomPalette(){ protected static ColorModel getCustomPalette(){
byte[] finalPalette = new byte[32*4*8]; return new IndexColorModel(8,65,generalPalette,0,false,32);
for (int i=0;i<8;i++) {
int k=0;
for (int j=0;j<generalPalette.length;j+=3) {
finalPalette[(32*4*i)+k+0]=(byte)generalPalette[j+0];
finalPalette[(32*4*i)+k+1]=(byte)generalPalette[j+1];
finalPalette[(32*4*i)+k+2]=(byte)generalPalette[j+2];
finalPalette[(32*4*i)+k+3]=(byte)(255-(i*(256/8)));
//System.out.println("Color "+(k/4)+": "+finalPalette[(32*4*i)+k+0]+"/"+finalPalette[(32*4*i)+k+1]+"/"+finalPalette[(32*4*i)+k+2]+"/"+finalPalette[(32*4*i)+k+3]);
k+=4;
}
}
IndexColorModel model = new IndexColorModel(8,256,finalPalette,0,true,32);
return model;
} }
/** /**

@ -64,7 +64,7 @@ public abstract class Object implements GameEntity{
this.spr = spr; this.spr = spr;
} }
public Alpha getTransparency() { public Alpha getTransparency() {
return getTransparency(); return transparency;
} }
public void setTransparency(Alpha alpha) { public void setTransparency(Alpha alpha) {
this.transparency=alpha; this.transparency=alpha;
@ -75,8 +75,8 @@ public abstract class Object implements GameEntity{
public void drawOverlay(byte[] p) { public void drawOverlay(byte[] p) {
} }
protected void Draw(byte[] canvas, int index, PaletteColor col, Alpha alpha) { protected void Draw(byte[] canvas, int index, PaletteColor col) {
DrawLoop.Draw(canvas, index, (byte)col.ordinal(), alpha); DrawLoop.Draw(canvas, index, (byte)col.ordinal());
} }
protected void Draw_Rect(byte[] p,PaletteColor col,double x,double y,double w,double h) { protected void Draw_Rect(byte[] p,PaletteColor col,double x,double y,double w,double h) {

@ -1,5 +1,6 @@
package sig.objects; package sig.objects;
import sig.engine.Alpha;
import sig.engine.AnimatedSprite; import sig.engine.AnimatedSprite;
import sig.engine.Panel; import sig.engine.Panel;
import sig.engine.Rectangle; import sig.engine.Rectangle;

@ -194,7 +194,7 @@ public class EditorRenderer extends LevelRenderer{
if (index<0||index>=p.length) { if (index<0||index>=p.length) {
continue; continue;
} }
Draw(p,index,PaletteColor.BLACK,Alpha.ALPHA0); Draw(p,index,PaletteColor.BLACK);
} }
} }
if (y%Tile.TILE_SCREEN_COUNT_Y==0) { if (y%Tile.TILE_SCREEN_COUNT_Y==0) {
@ -205,7 +205,7 @@ public class EditorRenderer extends LevelRenderer{
if (xpos<0||xpos>=Map.MAP_WIDTH||ypos<0||ypos>=Map.MAP_HEIGHT||index<0||index>=p.length) { if (xpos<0||xpos>=Map.MAP_WIDTH||ypos<0||ypos>=Map.MAP_HEIGHT||index<0||index>=p.length) {
continue; continue;
} }
Draw(p,index,PaletteColor.BLACK,Alpha.ALPHA0); Draw(p,index,PaletteColor.BLACK);
} }
} }
} }

@ -168,9 +168,16 @@ public class LevelRenderer extends Object{
for (int y=0;y<RabiClone.BASE_HEIGHT;y++) { for (int y=0;y<RabiClone.BASE_HEIGHT;y++) {
for (int x=0;x<RabiClone.BASE_WIDTH;x++) { for (int x=0;x<RabiClone.BASE_WIDTH;x++) {
int index = y*RabiClone.BASE_WIDTH+x; int index = y*RabiClone.BASE_WIDTH+x;
p[index] = targetBackground.getPixels()[ if(RabiClone.player!=null && RabiClone.player.isUnderwater()){
((y+(int)(getY()*targetBackground.getScrollSpeed()))%targetBackground.getHeight())*targetBackground.getWidth()+((x+(int)(getX()*targetBackground.getScrollSpeed()))%targetBackground.getWidth()) p[index] = (byte)(targetBackground.getPixels()[
]; ((y+(int)(getY()*targetBackground.getScrollSpeed()))%targetBackground.getHeight())*targetBackground.getWidth()+((x+(int)(getX()*targetBackground.getScrollSpeed()))%targetBackground.getWidth())
]+33);
}
else{
p[index] = targetBackground.getPixels()[
((y+(int)(getY()*targetBackground.getScrollSpeed()))%targetBackground.getHeight())*targetBackground.getWidth()+((x+(int)(getX()*targetBackground.getScrollSpeed()))%targetBackground.getWidth())
];
}
} }
} }
} }

@ -70,7 +70,6 @@ public class Player extends PhysicsObject{
setJumpVelocity_UseDefaultStrategy(); setJumpVelocity_UseDefaultStrategy();
setMaxJumpCount_UseDefaultStrategy(); setMaxJumpCount_UseDefaultStrategy();
setGravity_UseDefaultStrategy(); setGravity_UseDefaultStrategy();
setTransparency(Alpha.ALPHA128);
} }
@Override @Override

Loading…
Cancel
Save