Skip to content

Commit

Permalink
....
Browse files Browse the repository at this point in the history
  • Loading branch information
donnaken15 committed Jan 8, 2021
1 parent f46d9cc commit 080c9b4
Show file tree
Hide file tree
Showing 21 changed files with 151 additions and 51 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ Play.bat

sfx/Sample*

mus/*.ogg
mus/*.wma

# Build results
[Dd]ebug/
[Dd]ebugPublic/
Expand Down
6 changes: 5 additions & 1 deletion doc/c.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,16 @@
</head>
<body>
<h1>Log of the Dreamscape</h1><br/>
<h2>Last updated: 01/03/21 5 AM</h2><br/>
<h2>Last updated: 01/07/21 6 AM</h2><br/>
<table>
<tr>
<th style="width:84px;">Date</th>
<th style="width:70vw;">Event</th>
</tr>
<tr>
<td class="center">01/07/21</td>
<td>15 TEXTURES FOR 4BPP! >:( CHANGING</td>
</tr>
<tr>
<td class="center">01/02/21</td>
<td>TILE CREATION@!!<br/>more stuff to do with uploading files in data links</td>
Expand Down
Binary file added lvl/STRESS_TEST_ASDFFF.klo
Binary file not shown.
2 changes: 2 additions & 0 deletions lvl/ideas.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@

header
0x00 - magic number (0x2)
????
0xXX - start pos (0x4)
0xXX - level type (0x1)
0x?? - setting to use 4bpp tiles
X - standard
1 - autoscroll
2 - board
Expand Down
Binary file modified lvl/klex01.klo
Binary file not shown.
Binary file removed lvl/klex01.klo.bak
Binary file not shown.
Binary file removed mus/file.orig.wav
Binary file not shown.
Binary file removed mus/file.wav
Binary file not shown.
Binary file added mus/w01_int.mp3
Binary file not shown.
Binary file added mus/w01_lp.mp3
Binary file not shown.
Binary file modified sfx/jump.wav
Binary file not shown.
2 changes: 1 addition & 1 deletion src/ctrl/draw.gml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if pause {
draw_sprite(pausescr,0,view_xview[0],view_yview[0])
draw_set_alpha(.5)
draw_rectangle_color(view_xview[0],view_yview[0],
view_wview[0],view_hview[0],
view_xview[0]+view_wview[0],view_yview[0]+view_hview[0],
c_black,c_black,c_black,c_black,false)
draw_sprite_part(hudspr,0,40,43,60,22,
view_xview[0]+(view_wview[0]/4)+30,view_yview[0]+(view_hview[0]/10))
Expand Down
16 changes: 16 additions & 0 deletions src/ctrl/step.gml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ if(view_wview[0] != winw ||
room_restart()
}

if keyboard_check_pressed(vk_tab) room_speed = 1000000
else if keyboard_check_released(vk_tab) room_speed = 60

if keyboard_check_pressed(vk_enter)
if pause
{
Expand All @@ -31,6 +34,7 @@ if keyboard_check_pressed(vk_enter)
}
else
{
pause_scroll = 0
// MAKE THIS BETTER SRSLY
//pausescr = sprite_create_from_screen(0,0,view_wview[0],view_hview[0],false,false,0,0)
//room_set_background_color(room,c_gray,false)
Expand All @@ -39,4 +43,16 @@ if keyboard_check_pressed(vk_enter)
file_delete(temp_directory+"/__TMPSURFACE__.PNG")
instance_deactivate_all(true)
pause = true
sound_play(snd_pause)
}

if pause
{
if keyboard_check_pressed(vk_up) || keyboard_check_pressed(vk_down)
{

}
}

x = player.x
y = player.y-10
55 changes: 44 additions & 11 deletions src/init.gml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ hud_enable_gems,
hud_enable_stars,
pause,pausescr
;
globalvar snd_wahoo;
fname = ""
path_root = program_directory+"/../"
path_src = path_root+"src/"
Expand Down Expand Up @@ -69,6 +70,7 @@ if fname != ""
object_event_add(controller,ev_draw,0,get_code(path_src+"ctrl/draw.gml",0))
object_event_add(player,ev_step,0,get_code(path_src+"klo/step.gml",0))
object_event_add(player,ev_draw,0,get_code(path_src+"klo/draw.gml",0))
object_event_add(tile,ev_create,0,get_code(path_src+"tile/create.gml",0))
object_event_add(tile,ev_step,0,get_code(path_src+"tile/step.gml",0))
object_event_add(tile,ev_draw,0,get_code(path_src+"tile/draw.gml",0))
}
Expand Down Expand Up @@ -160,19 +162,34 @@ if fname != ""
}
levelbounds[0] = 0 //top
levelbounds[1] = 0 //left
levelbounds[2] = levelsize[0]*16 //right
levelbounds[3] = levelsize[1]*16 //bottom
levelbounds[2] = levelsize[0]*4 //right
levelbounds[3] = levelsize[1]*8 //bottom
for (j=0;j<levelsize[1];j+=1)
{
for (i=0;i<levelsize[0];i+=2)
{
filecur += 1
file_bin_seek(lvinfo,filecur)
_tempvar0 = file_bin_read_byte(lvinfo)
if HIBIT(_tempvar0)
with instance_create(i*16,j*16,tile) { solid=1 }
if LOBIT(_tempvar0)
with instance_create((i*16)+16,(j*16),tile) { solid=1 }
filesz = file_bin_size(lvinfo)
//if (file_bin_position(lvinfo) < file_bin_size(lvinfo)) {
if (filecur < filesz) {
file_bin_seek(lvinfo,filecur)
_tempvar0 = file_bin_read_byte(lvinfo)
//if HIBIT(_tempvar0)
if (_tempvar0)
instance_create(i*4,j*8,tile)
//if LOBIT(_tempvar0)
//instance_create((i*8)+8,(j*8),tile)
} else {
abortload=1
show_error(
"File loading ended prematurely."+chr($D)+"Current level size: "+
string(levelsize[0])+"x"+string(levelsize[1])+chr($D)+"EOF position: "+
string(i+1)+"x"+string(j+1),false)
break;
}
}
if abortload { break; abortload = 0 }
}

//room_set_width(room_first,levelsize[0]*16)
//room_set_height(room_first,levelsize[1]*16)
Expand All @@ -195,6 +212,14 @@ if fname != ""
}*/
//show_message(string(startpos[0]))
}
else {
show_error("Invalid file signature.",false)
game_end()
}
}
else {
show_error("Invalid file signature.",false)
game_end()
}

file_bin_close(lvinfo)
Expand All @@ -207,6 +232,15 @@ if fname != ""
sprite_replace(hudspr,path_gfx+"common/hud.png",0,1,0,0,0)
confnt = font_add_sprite(sprite_add(path_gfx+"misc/debug.png",94,0,0,0,0),ord('!'),0,0)
}

/// SOUND STUFF
{
globalvar snd_jump, snd_land, snd_pause, snd_scroll;
snd_jump = sound_add(path_sfx+"jump.wav",0,1)
snd_land = sound_add(path_sfx+"land.wav",0,1)
snd_pause = sound_add(path_sfx+"pause.wav",0,1)
snd_scroll = sound_add(path_sfx+"scroll.wav",0,1)
}

/// PLAYER STUFF
{
Expand All @@ -216,11 +250,10 @@ if fname != ""
{
//var char_index, char_speed, player_speed;
//player_speed = 3
x = startpos[0] * 16
y = startpos[1] * 16
x = startpos[0] * 8
y = startpos[1] * 8
image_xoffset = 0
image_yoffset = 0
collision=0
collision[0] = -20
collision[1] = -7
collision[2] = 14
Expand Down
39 changes: 23 additions & 16 deletions src/klo/draw.gml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ draw_set_alpha(1)
draw_line_color(x,y,x+8+(flip*-16),y,c_lime,c_lime)
draw_line_color(x,y+1,x,y+8,c_blue,c_blue)

draw_line_color(levelbounds[2],0,levelbounds[2],640,c_red,c_red)
//draw_line_color(levelbounds[2],0,levelbounds[2],640,c_red,c_red)

draw_rectangle_color(x+collision[1],y+collision[0],x+collision[2],y+collision[3],c_red,c_red,c_red,c_red,1)

Expand Down Expand Up @@ -61,7 +61,7 @@ switch (floor(char_index))
draw_sprite_part_ext(klospr,0,28,72,26,26,round(x)-11+3+(flip*(31-7)),round(y)-24-2,1+(flip*-2),1,c_white,1)
break
case 20:
char_speed = 0.22
char_speed = 0.5
draw_sprite_part_ext(klospr,0,1,181,23,28,round(x)-11+5+(flip*(31-11+1)),round(y)-25-2,1+(flip*-2),1,c_white,1)
break
case 21:
Expand All @@ -76,7 +76,7 @@ switch (floor(char_index))
draw_sprite_part_ext(klospr,0,71,181,24,28,round(x)-13+5+(flip*(31-7+1)),round(y)-25-2,1+(flip*-2),1,c_white,1)
break
case 25:
char_speed = 0.22
char_speed = 0.5
draw_sprite_part_ext(klospr,0,96,181,24,27,round(x)-13+5+(flip*(31-8+1)),round(y)-25-2,1+(flip*-2),1,c_white,1)
break
case 26:
Expand All @@ -89,6 +89,7 @@ switch (floor(char_index))
draw_sprite_part_ext(klospr,0,168,183,21,30,round(x)-12+5+(flip*(31-10+1)),round(y)-27-3,1+(flip*-2),1,c_white,1)
break
case 29:
char_speed = 0.277
draw_sprite_part_ext(klospr,0,190,183,21,32,round(x)-11+5+(flip*(31-12+1)),round(y)-31-3,1+(flip*-2),1,c_white,1)
break
case 31:
Expand All @@ -97,7 +98,7 @@ switch (floor(char_index))
draw_sprite_part_ext(klospr,0,212,183,21,32,round(x)-11+5+(flip*(31-12+1)),round(y)-31-3,1+(flip*-2),1,c_white,1)
break
case 40:
char_speed = 0.25
char_speed = 0.47
draw_sprite_part_ext(klospr,0,121,155,21,27,round(x)-15+11+(flip*(31-16+1)),round(y)-25-2,1+(flip*-2),1,c_white,1)
break
case 41:
Expand All @@ -117,28 +118,34 @@ switch (floor(char_index))
if floor(char_index) >= 0 && floor(char_index) < 10
draw_sprite_part_ext(klospr,0,86,21,16,4,round(x)-5+(flip*18),round(y)-4,1+(flip*-2),1,c_white,1)

draw_set_color(c_red)
draw_rectangle(touching.x,touching.y,touching.x+7,touching.y+7,true)

//draw_sprite_general(hudspr,0,153,0,1,16,view_xview[0],view_yview[0]+view_hview[0]-16,view_wview[0],1,0,c_white,c_white,c_white,c_white,1)
//draw_sprite_part(hudspr,0,0,0,153,16,view_xview[0],view_yview[0]+view_hview[0]-16)
//draw_sprite_part(hudspr,0,0,0,8,16,view_xview[0]+view_wview[0]-8,view_yview[0]+view_hview[0]-16)

//set px437 font
/*
draw_set_font(confont)
draw_set_color(c_black)

//draw_set_font(confont)
//draw_set_color(c_black)
//draw_set_color(c_red)
//draw_set_font(confnt)
//draw_set_color(c_white)
draw_set_font(confnt)
draw_set_color(c_white)
//draw_set_valign(fa_bottom)
draw_set_valign(fa_top)
//draw_text(view_xview[0],view_yview[0],
draw_text(view_xview[0],view_yview[0],

/*draw_text(view_xview[0],view_yview[0],
"pos: "+string_format(x,6,1)+" * "+string_format(y,6,1)+"
grav: "+string_format(gravity,4,1)+
" vsp: "+string_format(vspeed,3,1)+"
scale: "+string(window_get_region_scale())+"
res:"+string(view_wview[0])+"*"+string(view_hview[0])/* +"
lvsz:"+string(levelsize[0])+"*"+string(levelsize[1])+"
bounds:"+string(levelbounds[2])+"*"+string(levelbounds[3])+"
view:"+string(view_xview[0]+view_wview[0]) */
//)
scale: "+string(window_get_region_scale())+" fps: "+string(fps)+"
res: "+string(view_wview[0])+"*"+string(view_hview[0])+"
touching: "+string(
collision_rectangle(x+collision[1],
y+collision[0],
x+collision[2],
y+collision[3],tile,false,true))+"
char idx: "+string(char_index))*/

70 changes: 53 additions & 17 deletions src/klo/step.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
player_speed = 1.5
view_hspeed[0] = 1.5

if !ground && gravity = 0 { gravity = 0.25 }
if !ground && gravity = 0 { gravity = 0.21 }

if vspeed >= 4 gravity = 0
if vspeed >= 3 gravity = 0

if keyboard_check(vk_right) && !keyboard_check(vk_left) { flip = 0 x += player_speed moving = 1 }
if keyboard_check(vk_left) { flip = 1 if x > 0 x -= player_speed moving = 1 }
Expand All @@ -18,26 +18,15 @@ if (keyboard_check_pressed(vk_left) ||
if ((keyboard_check_released(vk_left) ||
keyboard_check_released(vk_right)) && ground && !moving) char_index = 0

if keyboard_check_pressed(vk_tab) room_speed = 1000000
else if keyboard_check_released(vk_tab) room_speed = 60

if ground {
if vspeed < 0 char_index = 25
if vspeed > 0 char_index = 27
}

if vspeed != 0 { ground = 0 }

if vspeed = 0 && gravity = 0 && ground && keyboard_check_pressed(vk_space)
{ jump = 1 ground = 0 last_char_index = char_index char_index = 20 vspeed = -6 }
{ jump = 1 ground = 0 sound_play(snd_jump) last_char_index = char_index char_index = 20 vspeed = -4.4 }

if vspeed >= 0 && jump { char_index = 25 jump = 0 }

if x + collision[1] < levelbounds[0] || x + collision[2] > levelbounds[2] x = xprevious

if y + collision[3] > levelbounds[3] {
y = levelbounds[3] gravity = 0 vspeed = 0 ground = 1
if moving char_index = 10 else char_index = 40 }
if moving { if slide < 6 slide += 0.5 }
else { if slide > 0 { slide -= 1 if !flip x += 1 else x -= 1 } }

view_xview[0] = round(x) - round(view_wview[0]/2)
view_yview[0] = floor(y) - floor(view_hview[0]/2)
Expand All @@ -55,5 +44,52 @@ if (view_yview[0] < levelbounds[1])
//{ view_xview[0] = player.x - (view_wview[0]/2)
//view_yview[0] = player.y - (view_hview[0]/2) }


/*instance_activate_region(
view_xview[0]-(view_wview[0]/2),
view_yview[0]-(view_hview[0]/2),
view_xview[0]+(view_wview[0]*1.5),
view_yview[0]+(view_hview[0]*1.5),
true
)
instance_deactivate_region(
view_xview[0]-(view_wview[0]/2),
view_yview[0]-(view_hview[0]/2),
view_xview[0]+(view_wview[0]*1.5),
view_yview[0]+(view_hview[0]*1.5),
false,true
)*/

/*if x + collision[1] < levelbounds[0] ||
x + collision[2] > levelbounds[2] x = xprevious
if y + collision[3] > levelbounds[3] { sound_play(snd_land)
y = levelbounds[3] gravity = 0 vspeed = 0 ground = 1
if moving char_index = 10 else char_index = 40 }*/

repeat (64)
{
touching = collision_rectangle(x+collision[1],y+collision[0],x+collision[2],y+collision[3],all,false,true)
if touching != noone
{
if (x > touching.x || x < touching.x + 16) && y < touching.y
{
x = xprevious
y = yprevious
slide = 0
}
if (y > touching.y && y < touching.y + 3 && (x >= touching.x && x <= touching.x + 16) && (!ground || falling))
{
sound_play(snd_land)
y = touching.y gravity = 0 vspeed = 0 ground = 1 falling = 0
if moving char_index = 10 else char_index = 40
}
}
else {
if ground
char_index = 25
ground = 0
falling = 1
}
}

Binary file modified src/proj/.gm81
Binary file not shown.
Binary file modified src/proj/installer/Cloneoa.ifp
Binary file not shown.
Binary file modified src/proj/installer/test_original.exe
Binary file not shown.
3 changes: 3 additions & 0 deletions src/tile/create.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
solid=1
sprite_index=collision_7x7
//object_set_mask(self,collision_15x15)
6 changes: 4 additions & 2 deletions src/tile/draw.gml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
draw_set_alpha(1)
draw_set_color(c_black)
draw_rectangle(x,y,x+15,y+15,false)
draw_set_color(c_gray)
draw_rectangle(x,y,x+7,y+7,false)
//draw_set_color(c_red)
//draw_rectangle(x,y,x+7,y+7,true)

0 comments on commit 080c9b4

Please sign in to comment.