Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019

Started by Qube, August 25, 2019, 22:40:34

Previous topic - Next topic

iWasAdam

tiny filling in a wisdom tooth at the back :/

much happier waiting for this to come out though:


NOMNOM Icecream!

Derron

@ ice cream
I would think it might look better if the ice cream was not put on top of each other (which is the "Hamburger style" - especially with that meat paddy in the middle). It look "stuffed" compared to the "one middle, one left top and one right top". Maybe ice cones are filled that way in your region ?
At least putting them "bottom, top left, top right" allows to save some vertical space - if the creature is already a big too tall.


Wonder what sweets you come up with next (jelly beans, yelli/gummi bears with teeth, candy canes, licorice ...sticks(?), chili chocolate bars, ...)


@ wisdom tooth
Only one left here others already pulled as they grew odd :-). "Have Fun".


bye
Ron

Xerra

Quote from: Derron on September 03, 2019, 07:41:32
Xerra, you need to move away from "if KEY_RIGHT then playerX = playerX + dx*speed".
Abstract "input" from "commands".

If KEY_RIGHT then movement.x = 1
If KEY_LEFT then movement.x = -1
If JOYPAD_LEFT then movement.x = -1
... or even abstract more and think of each input controller being of the same type and then just connect the appropriate one.

later you update the player and if movement.x is < 0 move to the left, if it is > 0 to the right and else you stand still (or fall/jump if you currently are doing this).
Abstraction (or using custom variables like MY_KEY_RIGHT) allow to reconfigure it once (key mapping) instead of having to check all your code files.

Derron, you've never seen a bit of code I've done so what makes you think I'm doing it the way you suggest? The reason I'm tinkering with a control system for such a time is because I want to make it feel right with different options so mouse, for example, lets you move the player character faster, as it should else you're constantly running out of mouse space. Gamepad means I need to think about possible 359' directional movement rather than just 8 directions keyboard gives me.

I've never put in controls for anything other than keys in my previous game so i'm working on putting options in for stuff like mouse threshold that players can adjust so it feels playable with a mouse which also takes up time.

I'm tempted to post the control code how it looks at the moment so you can see this but I'm also wary that you might pull it to pieces anyway. Maybe I'll do it once the games done so it won't hold me up if i get paranoid about doing stuff wrong :-)
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Xerra

Ah, fuck it.

Create player event


/// @description Create
//
// (C) Tony Brice, 2019
//
// Last Modified - 02/09/2019

//----------------------------------------------------------------------
// Mouse Control Stuff
//----------------------------------------------------------------------

prevMouseX = mouse_x;
prevMouseY = mouse_y;
xMove = 0;
yMove = 0;
// Pixels to incement player in x and y directions when moved with mouse
mouseXSpeed = 32;
mouseYSpeed = 16;

// Distance mouse must move further than before player will move.
mouseXThreshold = 8;
mouseYThreshold = 8;

keyboardSpeed = 16;



Step Event



/// @description Step
//
// (C) Tony Brice, 2019
//
// Last Modified - 02/09/2019

if (global.currentGameState == gameState.Paused) {
exit;
}

xMove = 0;
yMove = 0;

if (mouse_x > prevMouseX+mouseXThreshold) {
xMove += mouseXSpeed;
}

if (mouse_x < prevMouseX-mouseXThreshold) {
xMove -= mouseXSpeed;
}

if (mouse_y > prevMouseY+mouseYThreshold) {
yMove += mouseYSpeed;
}

if (mouse_y < prevMouseY-mouseYThreshold) {
yMove -= mouseYSpeed;
}

// Keyboard
if keyboard_check(vk_down) {
yMove = keyboardSpeed;
}

if keyboard_check(vk_up) {
yMove = -keyboardSpeed;
}

if keyboard_check(vk_left) {
xMove = -keyboardSpeed;
}

if keyboard_check(vk_right) {
xMove = keyboardSpeed;
}

if keyboard_check_pressed(vk_space) || keyboard_check_pressed(vk_return) {
// Fire at will, Sire.
if (mouseXThreshold == 4) {
mouseXThreshold = 8;
} else {
mouseXThreshold = 4;
}
scrSoundEffect(sndBullet,false);
}

// Move player
x += xMove;
y += yMove;

// Player boundaries
if (x < 16) {
x = 16;
}

if (x > 1008) {
x = 1008;
}

if (y < 500) {
y = 500;
}

if (y > 752) {
y = 752;
}



Remember, very W.I.P.
M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Derron

Excuse... seem to have misunderstood you there. Just wanted to help you out as quick as possible so you could continue your coding adventure without having to wait for incoming help/suggestions.


Mouse movement does not just contain distance...but also acceleration ... maybe this brings up some new ideas?




Or define some kind of mouse sensitivity/scaling?

For gamepads you accelerate while pressed, same for keyw. Mouse is the only exception as it does not have on/off for movement.


Yet this here can still be abstracted so that behaviour can be adjusted/changed afterwards.


Edit: for mouse control I would keep it simple: lastPos < currentPos equals to "currently pressed/accelerating". LastPost = currentPos equals to "still pressed/no longer accelerating" and  lastPos > currentPos...think you got it.
With acceleration this might work if acceleration finishes somewhen (so space on your desk is enough when moving with slow/normal speed).

Bye
Ron

Matty

Hadn't thought of entering, but drew some character sprites the other day and decided bugger it I'll enter with the work I've been doing.  It fits both categories,  tactical rpg and retro endless.....available on my website, but unfinished.....games section, last game on list.....see attached for image..



iWasAdam

mmm, interesting stuff :)
I'm working on walk cycles - one direction sorted - 3 to to  :'(

Matty

Another worklog with some new screenies...

http://concavetales.com/exercises/?page=7282

Game so far using my web browser javascript engine has only needed 1227 new lines of code....


gamedataonline.js
1598 in new
437 in old
1161 new lines of code
init.js
418 in new
355 in old
63 new lines of code
renderer.js
663 in new
660 in old
3 new lines of code

Total new lines of code 1227 lines.

iWasAdam

working on walk frames - not something I've really done much of:

but does allow me to use a few new things

iWasAdam

Still no name, but I have finally nailed what it is and the general story:

You play as a burly red panda (I like the idea of Redd for his name)
And your task is to raid picnic baskets and defeat the evil food, maybe even kick a few crates in the process!
Defeat the food and the exit appears. but Wait... There's a twist...! :o

Xerra

I have a name, a background story, a player controllable erm, thing. As I said before I think i'll have a grid, some nasty things, lots of bullets and a feel of a very old retro game. I am planning to twist on it with stuff like the image below.

M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

iWasAdam

#87
Super NICE planet :)

so todays tasty morsels are text:


And did I say picnic basket?


Plus the tooth is nice and happy too :) No painkillers or injections, so no numb dribbly mouth either - just took 15 minutes... YAY!

Xerra

M2 Pro Mac mini - 16GB 512 SSD
ACER Nitro 5 15.6" Gaming Laptop - Intel® Core™ i7, RTX 3050, 1 TB SSD
Vic 20 - 3.5k 1mhz 6502

Latest game - https://xerra.itch.io/Gridrunner
Blog: http://xerra.co.uk
Itch.IO: https://xerra.itch.io/

Derron

Seems to become a military real time strategy game - warfare mode enabled.

I hope at the end all these little characters have some wink/blink/wobbly animations or idle stuff - these most often make the look "uber cute" :-)


bye
Ron