Ooops
April 10, 2020, 08:14:52 AM

Author Topic: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019  (Read 15890 times)

Online iWasAdam

  • Hero Member
  • *****
  • Posts: 1574
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #75 on: September 03, 2019, 08:43:03 AM »
tiny filling in a wisdom tooth at the back :/

much happier waiting for this to come out though:


NOMNOM Icecream!

Offline Derron

  • Hero Member
  • *****
  • Posts: 2844
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #76 on: September 03, 2019, 09:42:51 AM »
@ 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

Offline Xerra

  • Hero Member
  • *****
  • Posts: 839
    • Retro Evolved
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #77 on: September 03, 2019, 05:39:16 PM »
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 :-)

Offline Xerra

  • Hero Member
  • *****
  • Posts: 839
    • Retro Evolved
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #78 on: September 03, 2019, 05:42:44 PM »
Ah, fuck it.

Create player event

Code: [Select]
/// @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

Code: [Select]

/// @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.

Offline Derron

  • Hero Member
  • *****
  • Posts: 2844
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #79 on: September 03, 2019, 06:23:04 PM »
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

Offline Matty

  • Hero Member
  • *****
  • Posts: 968
    • MattiesGames
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #80 on: September 03, 2019, 11:41:46 PM »
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..


Offline Matty

  • Hero Member
  • *****
  • Posts: 968
    • MattiesGames
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #81 on: September 04, 2019, 02:59:41 AM »

Online iWasAdam

  • Hero Member
  • *****
  • Posts: 1574
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #82 on: September 04, 2019, 08:35:28 AM »
mmm, interesting stuff :)
I'm working on walk cycles - one direction sorted - 3 to to  :'(

Offline Matty

  • Hero Member
  • *****
  • Posts: 968
    • MattiesGames
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #83 on: September 04, 2019, 07:18:53 PM »
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....

Code: [Select]
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.

Online iWasAdam

  • Hero Member
  • *****
  • Posts: 1574
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #84 on: September 05, 2019, 07:20:30 AM »
working on walk frames - not something I've really done much of:

but does allow me to use a few new things

Online iWasAdam

  • Hero Member
  • *****
  • Posts: 1574
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #85 on: September 05, 2019, 02:41:34 PM »
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

Offline Xerra

  • Hero Member
  • *****
  • Posts: 839
    • Retro Evolved
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #86 on: September 05, 2019, 05:40:38 PM »
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.


Online iWasAdam

  • Hero Member
  • *****
  • Posts: 1574
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #87 on: September 06, 2019, 03:13:10 PM »
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!

Offline Xerra

  • Hero Member
  • *****
  • Posts: 839
    • Retro Evolved
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #88 on: September 06, 2019, 05:28:24 PM »
Adam, what on earth are you up to ........ ?

Offline Derron

  • Hero Member
  • *****
  • Posts: 2844
Re: Code a game comp - MIX-IT-UP - Aug 25th to Oct 20th 2019
« Reply #89 on: September 06, 2019, 06:11:40 PM »
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

 

SimplePortal 2.3.6 © 2008-2014, SimplePortal